What worksI have the following setup:server <-NAT-> VPS <-> clientI have set up ssh to my server through a reverse tunnel and the following settings:on VPS,GatewayPorts yeson server:autossh -f -M 57575 -N -R <VPS ip>:9991:localhost:<server ssh port> vpsWith this setup, I can simply ssh -p 9991 <server user>@<VPS ip> and log into my server from the client.What doesn'ton VPS,GatewayPorts yes, and otherwise identical setup to SSH caseon server:autossh -f -M 57576 -N -R <VPS ip>:9992:localhost:8988 vpspython -m http.server 8988 to start the http server. I can confirm it binds to 0.0.0.0 and I can access it on the local machine.However, when I try to access the website via http://<VPS ip>:9992 I get an ERR_EMPTY_RESPONSE.Looking at netstat, the two situations seem identical. On VPS:tcp        0      0 0.0.0.0:9992            0.0.0.0:*               LISTEN      -tcp        0      0 0.0.0.0:9991            0.0.0.0:*               LISTEN      -On server:tcp        0      0 0.0.0.0:8988            0.0.0.0:*               LISTEN      21003/pythontcp        0      0 0.0.0.0:<ssh port>           0.0.0.0:*               LISTEN      550/sshdtcpdump shows that a connection is established with port 9992 on the VPS, but nothing reaches port 8988 on server. The connection is FINned immediately on the VPS.Why doesn't this work, when the exactly analogous SSH situation does?
Reverse SSH tunnel works for SSH but not for HTTP
ssh;ssh tunneling;http
You should start the server first and then initiate the remote port forwarding. Not the other way round.I am not sure why is that, but obviously it resolves the issue.