Can't RPC to Bitcoind (C# / Windows) I am running a node on Windows Server 2016.
Everything seems to be running fine.

If I go to https://bitnodes.earn.com/ and put myip:8333, the node is successfully reachable.

My bitcoin.conf is:
    server=1
    txindex=1
    rpcuser=...
    rpcpassword=...

Locally, I can access it:

bitcoin-cli.exe -rpcuser=... -rpcpassword=... getinfo


returns:

{
  "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",
  "version": 150001,
  "protocolversion": 70015,
  "walletversion": 139900,
  "balance": 0.00000000,
  "blocks": 0,
  "timeoffset": 0,
  "connections": 16,
  "proxy": "",
  "difficulty": 1,
  "testnet": false,
  "keypoololdest": 1506982194,
  "keypoolsize": 2000,
  "paytxfee": 0.00000000,
  "relayfee": 0.00001000,
  "errors": ""
}


However, any C# bitcoin lib I tried always returns the same web exception when trying to connect to bitcoind:

"The underlying connection was closed: The connection was closed unexpectedly."


and, also, I do not understand why some samples use port 8332, some 8333, etc. I don't have anything listening to 8332.

What could I be missing?
I do not understand why some samples use port 8332, some 8333, etc.


Port 8333 is the port that bitcoin uses to connect to other nodes on the network. Port 8332 is the default port for a bitcoin RPC interface. To connect with RPC, use port 8332 or specify a different port with rpcport=&lt;port&gt; option