Search code examples
curlportforwardingssh-tunnel

curl: (52) Empty reply from server via ssh port forwarding


I have a chrome remote debugging server running on my Home PC which I want to access from my public server.

I already have a reverse ssh tunnel created from the server to my Home PC. I did ssh port forwarding as follows:

ssh  -L 9222:localhost:9222 user@localhost -p <SSH_PORT> -N 

Now when I run curl on my public server it gives empty response

$ curl http://localhost:9222 -v
* Rebuilt URL to: http://localhost:9222/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9222 (#0)
> GET / HTTP/1.1
> Host: localhost:9222
> User-Agent: curl/7.61.1
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server

How to resolve this?


Solution

  • The sshd server was not able to read from chrome server as the socket was giving error while opening.

    The issue I faced was https://github.com/PowerShell/Win32-OpenSSH/issues/414 with https://github.com/PowerShell/Win32-OpenSSH/issues/244#issuecomment-239071490 as the fix.