Tunneling rpc "ECONNREFUSED" and "Empty reply from server"


Playing with an hsd node

When I run hsd on my laptop, no flags, Im able to connect with either hsd-rpc or rpc

hsd-rpc getnameinfo handshake

curl -X POST --data ‘{
“method”: “getnameinfo”,
“params”: [ “handshake” ]

However my goal was to throw it on a pi. Seems to be booting fine and happily “Adding block: 1951.”

This is where my setup gets a little complicated, Im tunneling port 13037 from that machine to my localhost:13037

However both hsd-rcp and curl fail

root@0ac40f3e43e2:/usr/src/app# hsd-rpc getnameinfo handshake
Error: connect ECONNREFUSED
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1044:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)
root@0ac40f3e43e2:/usr/src/app# curl -X POST --data '{

"method": "getnameinfo",
"params": [ "handshake" ]

curl: (7) Failed to connect to port 13037: Connection refused

I have the exact same setup on the exact same machine concurrently for an eth node rpc. So Im pretty sure my tunneling is sound…

Ive doubled checked ports, flags, auth. I think I should be set… Just throwing this up here in case someone can think of something dumb Im missing.

Thanks for the read through.


Hey @jacobrosenthal, the HTTP server listens on by default, try adding this to your config:



I added that then got at least a far more instructive error
Unauthorized (bad API key).

Which was fixable with (in my case since I dont need auth for security) --no-auth

Thanks so much!


You can set the api key with the environment variable HSD_API_KEY so that you don’t have to use the flag --api-key for every cli command. I’m assuming that your pi is on your local network, remember that without the api-key and TLS, anybody on your local network will be able to have access to your node and/or wallet which allows for a denial of service or steal all the money attack.