<p>You are defining RPC port <code>18443</code> and attempting to connect to <code>18444</code> in your example.</p>
<p>There's no situation where you should attempt to <code>rpcallowip</code> to anything but localhost, don't get used to doing that or making systems which require it. There is no situation in which this is safe to do, even <code>regtest</code> can cause damage to your system.</p>

CC BY-SA 4.0
2021-02-23T21:48:20.040Z
when I change the curl cmd to IP:18443 I get connection refused `curl: (7) Failed to connect to 192.168.86.30 port 18443: Connection refused`
bitblockwhat
CC BY-SA 4.0
2021-02-23T21:49:57.803Z
You will still be binding the RPC port to `localhost` irrespective of what the `rpcallowip` value is set to. The software doesn't make this easy because it's such a poor configuration option, you would have to change `rpcbind` as well.
Claris
CC BY-SA 4.0
2021-02-23T21:57:30.460Z
ok so I should change rpcallowip to this `rpcallowip=127.0.0.1` ?  and rpcbind to the local IP of my node?   I originally had that but it looked like it was causing issues.  should I also  rpcallow my local node IP like here?  [link](https://bitcoin.stackexchange.com/a/88722/116250)
bitblockwhat
CC BY-SA 4.0
2021-02-23T22:06:18.917Z
ok that got me connected thanks!  this is my updated bitcoin.conf config which works

`[regtest]
# Listen for incoming connections
port=18444
# RPC allow all IP
rpcallowip=127.0.0.1
rpcallowip=192.168.86.30/24
# RPC bind IP
rpcbind=127.0.0.1 
rpcbind=192.168.86.30
# RPC port
rpcport=18443
`
bitblockwhat
CC BY-SA 4.0
2021-02-23T22:12:21.053Z
sorry I know I already accepted this answer, but any insight into the debug.log `ConflictInMapping` errors? I'm still getting them
bitblockwhat
CC BY-SA 4.0
2021-02-23T22:38:04.673Z
That's very unrelated to your concerns at all, that's to do with port forwarding for P2P communication which is not essential (and especially irrelevant for a regtest node).
Claris
CC BY-SA 4.0
2021-02-23T21:46:15.167Z
2021-02-23T21:46:15.167Z
Claris
<p>Hi I'm new to rpc curl cmds and having some issues connecting to my regtest node.  I'm getting &quot;empty reply from server&quot; which makes me think it is connecting but something is misconfigured.</p>
<p>Looking through various threads here I found similar things but nothing that quite fit the bill, but apologies if this is something that has already been covered.</p>
<p>bitcoin.conf settings</p>
<pre><code># Options only for regtest
[regtest]
# datadir
datadir=/mnt/mydisk/regtest
# Listen for incoming connections on non-default port.(default: 8333 or testnet: 18333)
port=18444
# RPC allow all IPS (shouldn't have this on mainnet)
rpcallowip=0.0.0.0/0
# RPC bind IP
#rpcbind=192.168.86.30
# RPC port(default:8332 or testnet:18332)
rpcport=18443
</code></pre>
<p>my curl cmd returns</p>
<pre><code>curl: (52) Empty reply from server
</code></pre>
<p>curl cmd</p>
<pre><code> curl --user xxxuser:xxxcookie --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;getblockcount&quot;, &quot;params&quot;: [] }' -H 'content-type: text/plain;'  http://192.168.86.30:18444/
</code></pre>
<p>I'm also seeing this in the debug.log but not sure what it means or how to fix</p>
<pre><code>UPnP: ExternalIPAddress = XX.XXX.XX.XXX
AddLocal(XX.XXX.XX.XXX:18444,3)
AddPortMapping(18444, 18444, 192.168.86.30) failed with code 718 (ConflictInMappingEntry)
UPNP_DeletePortMapping() returned: 606

</code></pre>
<p>Also worth noting I have another regtest node and the 2 nodes are connected without issue.</p>
<p>Any help appreciated.</p>

<json-rpc><regtest>
Cannot remote to regtest node with curl cmd - Empty reply from server
bitblockwhat
# Cannot remote to regtest node with curl cmd - Empty reply from server

(Asked by: username_0 on 2021-02-23)

Hi I'm new to rpc curl cmds and having some issues connecting to my regtest node.  I'm getting "empty reply from server" which makes me think it is connecting but something is misconfigured.
Looking through various threads here I found similar things but nothing that quite fit the bill, but apologies if this is something that has already been covered.
bitcoin.conf settings
# Options only for regtest
[regtest]
# datadir
datadir=/mnt/mydisk/regtest
# Listen for incoming connections on non-default port.(default: 8333 or testnet: 18333)
port=18444
# RPC allow all IPS (shouldn't have this on mainnet)
rpcallowip=0.0.0.0/0
# RPC bind IP
#rpcbind=192.168.86.30
# RPC port(default:8332 or testnet:18332)
rpcport=18443

my curl cmd returns
curl: (52) Empty reply from server

curl cmd
 curl --user xxxuser:xxxcookie --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;'  http://192.168.86.30:18444/

I'm also seeing this in the debug.log but not sure what it means or how to fix
UPnP: ExternalIPAddress = XX.XXX.XX.XXX
AddLocal(XX.XXX.XX.XXX:18444,3)
AddPortMapping(18444, 18444, 192.168.86.30) failed with code 718 (ConflictInMappingEntry)
UPNP_DeletePortMapping() returned: 606


Also worth noting I have another regtest node and the 2 nodes are connected without issue.
Any help appreciated.

**Tags:** json-rpc, regtest


---

## 1 answers

### Answer by username_1 on 2021-02-23. Score: 0 | Accepted answer

You are defining RPC port `18443` and attempting to connect to `18444` in your example.

There's no situation where you should attempt to `rpcallowip` to anything but localhost, don't get used to doing that or making systems which require it. There is no situation in which this is safe to do, even `regtest` can cause damage to your system.

> **Comments:**
> **username_0**: when I change the curl cmd to IP:18443 I get connection refused `curl: (7) Failed to connect to 192.168.86.30 port 18443: Connection refused`  
> **username_1**: You will still be binding the RPC port to `localhost` irrespective of what the `rpcallowip` value is set to. The software doesn't make this easy because it's such a poor configuration option, you would have to change `rpcbind` as well.  
> **username_0**: ok so I should change rpcallowip to this `rpcallowip=127.0.0.1` ?  and rpcbind to the local IP of my node?   I originally had that but it looked like it was causing issues.  should I also  rpcallow my local node IP like here?  [link](https://bitcoin.stackexchange.com/a/88722/116250)  
> **username_0**: ok that got me connected thanks!  this is my updated bitcoin.conf config which works  `[regtest] # Listen for incoming connections port=18444 # RPC allow all IP rpcallowip=127.0.0.1 rpcallowip=192.168.86.30/24 # RPC bind IP rpcbind=127.0.0.1  rpcbind=192.168.86.30 # RPC port rpcport=18443 `  
> **username_0**: sorry I know I already accepted this answer, but any insight into the debug.log `ConflictInMapping` errors? I'm still getting them  
> **username_1**: That's very unrelated to your concerns at all, that's to do with port forwarding for P2P communication which is not essential (and especially irrelevant for a regtest node).  

---

