title: I can not connect through RPC port bitcoind
body: <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>
  <pre><code>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://127.0.0.1:18332
  </code></pre>
  <p>It also works. But connecting through the public ip just return <code>Connection refused</code>.</p>
  <pre><code>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
  </code></pre>
  <p>It returns</p>
  <pre><code>curl: (7) Failed to connect to external-ip port 18332: Connection refused
  </code></pre>
  <p>Here is what my bitcoin.config file looks like,</p>
  <pre><code>blocksonly=1
  prune=1200
  rpcauth=username:hash
  rpcallowip=0.0.0.0/0
  
  [main]
  
  [test]
  
  [regtest]
  </code></pre>
  <p>The bitcoin node is runnning an ubuntu server and other applications/port allow external connections except all bitcoind RPC ports Is there away to fix this?</p>