Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: chegmarco on May 04, 2017, 11:53:10 AM



Title: How to allow the Bitcoind Server to listen to Port 8332 ?
Post by: chegmarco on May 04, 2017, 11:53:10 AM
How do I make the Bitcoind server listen to or link to the 8332 port of my Linux distribution via "netstat"? Because I noticed that this is because the Bitcoin does not listen to 8332 as I get the error below:

Quote
Warning: fopen(http://...@127.0.0.1:8332/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in /home/cheg/Downloads/piwallet/jsonRPCClient.php on line 133

Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://cheg:chego1@127.0.0.1:8332/' in /home/cheg/Downloads/piwallet/jsonRPCClient.php:141 Stack trace: #0 /home/cheg/Downloads/piwallet/classes/Client.php(17): jsonRPCClient->__call('getbalance', Array) #1 /home/cheg/Downloads/piwallet/classes/Client.php(17): jsonRPCClient->getbalance('zelles(chegadmi...', 6) #2 /home/cheg/Downloads/piwallet/index.php(22): Client->getBalance('chegadmin') #3 {main} thrown in /home/cheg/Downloads/piwallet/jsonRPCClient.php on line 141

So help me link the "Bitcoind" to 8332 with Netstat please.


Title: Re: How to allow the Bitcoind Server to listen to Port 8332 ?
Post by: bitfawkes on May 04, 2017, 04:02:34 PM
How do I make the Bitcoind server listen to or link to the 8332 port of my Linux distribution via "netstat"? Because I noticed that this is because the Bitcoin does not listen to 8332 as I get the error below:

Quote
Warning: fopen(http://...@127.0.0.1:8332/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in /home/cheg/Downloads/piwallet/jsonRPCClient.php on line 133

Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://cheg:chego1@127.0.0.1:8332/' in /home/cheg/Downloads/piwallet/jsonRPCClient.php:141 Stack trace: #0 /home/cheg/Downloads/piwallet/classes/Client.php(17): jsonRPCClient->__call('getbalance', Array) #1 /home/cheg/Downloads/piwallet/classes/Client.php(17): jsonRPCClient->getbalance('zelles(chegadmi...', 6) #2 /home/cheg/Downloads/piwallet/index.php(22): Client->getBalance('chegadmin') #3 {main} thrown in /home/cheg/Downloads/piwallet/jsonRPCClient.php on line 141

So help me link the "Bitcoind" to 8332 with Netstat please.
I'm not sure to full understand your problem but if you put this row of code in /home/user/.bitcoin/bitcoin.conf it should works as you want

Code:
rpcport=8332
daemon=1

goditela ;)


Title: Re: How to allow the Bitcoind Server to listen to Port 8332 ?
Post by: chegmarco on May 04, 2017, 04:40:58 PM
How do I make the Bitcoind server listen to or link to the 8332 port of my Linux distribution via "netstat"? Because I noticed that this is because the Bitcoin does not listen to 8332 as I get the error below:

Quote
Warning: fopen(http://...@127.0.0.1:8332/): failed to open stream: HTTP request failed! HTTP/1.0 401 Unauthorized in /home/cheg/Downloads/piwallet/jsonRPCClient.php on line 133

Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://cheg:chego1@127.0.0.1:8332/' in /home/cheg/Downloads/piwallet/jsonRPCClient.php:141 Stack trace: #0 /home/cheg/Downloads/piwallet/classes/Client.php(17): jsonRPCClient->__call('getbalance', Array) #1 /home/cheg/Downloads/piwallet/classes/Client.php(17): jsonRPCClient->getbalance('zelles(chegadmi...', 6) #2 /home/cheg/Downloads/piwallet/index.php(22): Client->getBalance('chegadmin') #3 {main} thrown in /home/cheg/Downloads/piwallet/jsonRPCClient.php on line 141

So help me link the "Bitcoind" to 8332 with Netstat please.
I'm not sure to full understand your problem but if you put this row of code in /home/user/.bitcoin/bitcoin.conf it should works as you want

Code:
rpcport=8332
daemon=1

goditela ;)

Thanks for your answer but I would like to know if you tried with rpcport=8332 ? And it worked ?


Title: Re: How to allow the Bitcoind Server to listen to Port 8332 ?
Post by: achow101 on May 04, 2017, 05:15:42 PM
The fact that you are getting an HTTP 401 error from connecting to port 8332 means that something (probably bitcoind) is listening on that port and can understand http. Thus bitcoind the issue is likely not related to bitcoind not connecting to the port but rather that you have configured it incorrectly.

You will get a HTTP 401 Unauthorized error if you do not have the "authorization" header or if the username/password in your auth header is incorrect. For the latter case, if you look in the debug.log file for Bitcoin Core, you will see a line like this:
Code:
ThreadRPCServer incorrect password attempt from 127.0.0.1
for each attempt at connecting.

Make sure that you are actually sending the username and password correctly and that what you set as username and password is the same thing as you have set in your bitcoin.conf file.