<blockquote>
  <p>I do not understand why some samples use port 8332, some 8333, etc.</p>
</blockquote>

<p>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 <code>rpcport=&lt;port&gt;</code> option</p>

CC BY-SA 3.0
2017-10-31T02:16:42.867Z
oh ok, so I'm going to look at a firewall issue then because 8333 is reachable and nothing replies at 8332
Thomas
CC BY-SA 3.0
2017-10-31T03:17:55.893Z
ok, I got it: the RPC calls are only allowing localhost by default...
Thomas
CC BY-SA 3.0
2017-10-31T03:25:25.093Z
Yes, you can allow other IPs with the `rpcallowip=<ip>` option
meshcollider
CC BY-SA 3.0
2017-11-15T21:56:38.267Z
@MeshCollider Is there a way to allow all IPs?
Eutherpy
CC BY-SA 3.0
2017-11-15T22:58:35.747Z
You can use wildcard `*` but is dangerous to accept connection from anywhere. You can limit to a specific IP range for example `192.168.0.*`
meshcollider
CC BY-SA 3.0
2017-10-31T02:15:37.813Z
2017-10-31T02:15:37.813Z
meshcollider
<p>I am running a node on Windows Server 2016.
Everything seems to be running fine.</p>

<p>If I go to <a href="https://bitnodes.earn.com/" rel="nofollow noreferrer">https://bitnodes.earn.com/</a> and put myip:8333, the node is successfully reachable.</p>

<p>My bitcoin.conf is:
    server=1
    txindex=1
    rpcuser=...
    rpcpassword=...</p>

<p>Locally, I can access it:</p>

<pre><code>bitcoin-cli.exe -rpcuser=... -rpcpassword=... getinfo
</code></pre>

<p>returns:</p>

<pre><code>{
  "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": ""
}
</code></pre>

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

<pre><code>"The underlying connection was closed: The connection was closed unexpectedly."
</code></pre>

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

<p>What could I be missing?</p>

<bitcoind><c#>
Can't RPC to Bitcoind (C# / Windows)
Thomas
# Can't RPC to Bitcoind (C# / Windows)

(Asked by: username_0 on 2017-10-31)

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?

**Tags:** bitcoind, c#


---

## 1 answers

### Answer by username_1 on 2017-10-31. Score: 1 | Accepted answer

> 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=<port>` option

> **Comments:**
> **username_0**: oh ok, so I'm going to look at a firewall issue then because 8333 is reachable and nothing replies at 8332  
> **username_0**: ok, I got it: the RPC calls are only allowing localhost by default...  
> **username_1**: Yes, you can allow other IPs with the `rpcallowip=<ip>` option  
> **username_2**: @MeshCollider Is there a way to allow all IPs?  
> **username_1**: You can use wildcard `*` but is dangerous to accept connection from anywhere. You can limit to a specific IP range for example `192.168.0.*`  

---

