Json-rpc fails with "No connection could be made because the target machine actively refused it" Playing around with litecoin json-rpc running on windows (the API is the same as bitcoin, so I am using bitcoin's references).

My litecoin.conf has the following data:

rpcuser=user
rpcpassword=pass
txindex=1


Based on the documentation I started the core client as .\litecoind.exe -server, and it looks like it works just fine because I can run various commands from another window (.\litecoin-cli.exe getblockcount and many other work as expected).

Now I wanted to make some json-rpc calls and I tried Go's library which bitcoin's developers recommend. I used the example from that library's github and the only modifications which I introduced were my user and pass in the definition of the ConnConfig.

The code fails during the execution of client.GetBlockCount() with an error: 


  Post http://localhost:8332: dial tcp [::1]:8332: connectex: No
  connection could be made because the target machine actively refused
  it.


I think that the problem is with json-rpc server but I have no idea how to verify that it works properly. Any idea how to fix it?
I was using bitcoin's port. Should have provided a port for litecoin: 9332.