Error connecting to RPC server

0

Ok, so my bitcoin node (0.15.1) is running, and fully synced up with the network. I'm using python and the 'bitcoinrpc' package. I want to access the RPC server from outside my network. I have RPC set up on the normal port 8332 which is opened up on my router. I have rpcallowip configured to the address of the computer I'm connecting from.

When I run my python program I get the following error, which I am having a hard time tracking down. (my program is called 'PollForAddress.py')

  File "PollForAddress.py", line 46, in <module>
    mempool = nodeRPC.getrawmempool()
  File "/usr/local/lib/python2.7/dist-packages/bitcoinrpc/authproxy.py", line 139, in __call__
    response = self._get_response()
  File "/usr/local/lib/python2.7/dist-packages/bitcoinrpc/authproxy.py", line 187, in _get_response
    'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)})
bitcoinrpc.authproxy.JSONRPCException: -342: non-JSON HTTP response with '403 Forbidden' from server

any ideas whats going wrong?

gearhead

Posted 2018-03-11T16:07:14.997

Reputation: 103

Answers

2

it looks like the server rejected the connection from client, try use this rpcallowip instead and see if it helps.

rpcallowip=0.0.0.0/0

Above decrease the rpc security but will allow all connection reguardless their ip address

zhiyan114

Posted 2018-03-11T16:07:14.997

Reputation: 528