<p>I have set up bitcoind, and I am able to run bitcoin-cli commands, I am also able to make request through RPC.</p>
<p>curl --user username:password --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;getblockchaininfo&quot;, &quot;params&quot;: [] }' -H 'content-type: text/plain;' <a href="http://127.0.0.1:18332" rel="nofollow noreferrer">http://127.0.0.1:18332</a></p>
<p>It also works. But connecting through the public ip just return Connection refused.</p>
<p>curl --user username:password --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;getblockchaininfo&quot;, &quot;params&quot;: [] }' -H 'content-type: text/plain;' http://public-ip:18332</p>
<p>It returns</p>
<p>curl: (7) Failed to connect to external-ip port 18332: Connection refused</p>
<p>Config file as follows.</p>
<p>server=1</p>
<p>rpcport=9776</p>
<p>rpcallowip=0.0.0.0/0</p>
<p>rpcbind=0.0.0.0</p>
<p>txindex=1</p>

CC BY-SA 4.0
2022-11-21T16:12:53.613Z
Looks like the host can't resolve the "external-ip" host?
Mercedes
CC BY-SA 4.0
2023-01-21T11:35:29.640Z
Did you find a solution? I am facing the exact same behaviour with bitcoin core 23 on both local and public network. On the local machine all works fine, but using an IP does not need to be resolved. FW and forwarding should be fine. Did you solve this? Can it be that curl demands https protocol or something like that?
jagottsicher
CC BY-SA 4.0
2023-01-22T12:02:53.307Z
Yes I found. Email: isti.ru.cse@gmail.com
Istiaque Ahmed
<bitcoin-core><bitcoind><bitcoin-cli>
I can not connect through RPC port bitcoind
Istiaque Ahmed
# I can not connect through RPC port bitcoind

(Asked by: username_0 on 2022-11-21)

I have set up bitcoind, and I am able to run bitcoin-cli commands, I am also able to make request through RPC.

curl --user username:password --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' <http://127.0.0.1:18332>

It also works. But connecting through the public ip just return Connection refused.

curl --user username:password --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://public-ip:18332

It returns

curl: (7) Failed to connect to external-ip port 18332: Connection refused

Config file as follows.

server=1

rpcport=9776

rpcallowip=0.0.0.0/0

rpcbind=0.0.0.0

txindex=1

**Tags:** bitcoin-core, bitcoind, bitcoin-cli

> **Comments:**
> **username_1**: Looks like the host can't resolve the "external-ip" host?  
> **username_2**: Did you find a solution? I am facing the exact same behaviour with bitcoin core 23 on both local and public network. On the local machine all works fine, but using an IP does not need to be resolved. FW and forwarding should be fine. Did you solve this? Can it be that curl demands https protocol or something like that?  
> **username_0**: Yes I found. Email: isti.ru.cse@gmail.com  

---

## 0 answers

