localtunnel / server

server for localtunnel.me
https://localtunnel.me
MIT License
3.05k stars 987 forks source link

Does the current server implementation work at all? #146

Open FransBCocq opened 3 years ago

FransBCocq commented 3 years ago

Referring to: https://github.com/localtunnel/server/issues/123#issuecomment-757930138

I'm encountering the same issue in a specific test scenario, where I try to traverse through Carrier Grade NAT (CGN). Therefore I set up the following GNS3 virtual network environment with some new findings, which might be interesting for you.

image

"Raspi-A-1" in the field hangar network is running the localtunnel client, which connects to "Proxy-1" in the home network, which runs the localtunnel server. This connection doesn't work and crashes immediately with the same error as @hailwood postet in this thread. For test purposes I made an exact copy of the "Proxy-1", called "CloneofProxy-1" and put it right next to the "Raspi-A-1" inside the same local subnet and this connection works flawlessly for some reason. So it seems that a connection to a different network with routers in between doesn't work with the current implementation of the localtunnel server. I also deployed the localtunnel server outside of this GNS3 environment on another VM with direct internet access to it, which doesn't work either, same with the docker container implementation.

Edit: The localtunnel client on the "Raspi-A-1" seems to be fine, because establishing and maintaining a connection to the public localtunnel.me server works.

Any ideas what is causing this strange behaviour?

Originally posted by @FransBCocq in https://github.com/localtunnel/server/issues/123#issuecomment-757930138

StyleT commented 3 years ago

Hi! Current implementation should be working in case firewalls you have between localtunnel client & server allow outgoing TCP connections on custom ports.

Also one of the reasons may be that your setup of the server instance restricts incoming TCP connections on ports 1024+.

Additionally here I started to do some PoC of the tunneling over websocket, which should allow to bypass the most restrictive firewalls. https://github.com/StyleT/mytunnel-server/tree/feature/ws_tunnel

steav commented 3 years ago

Hi @StyleT,

thank you for this websocket extension; this is amazing and exactly what I would need for my kubernetes nginx-ingress setup. Do you have any intention to finish this PoC? Could you give me some hints what is missing to allow localtunnel to work solely via nginx-ingress? Thanks a lot! Steav