Tunnel is disconnected almost immediately
See original GitHub issueHi Folks,
First, let me start with big kudos for the solution!
I’d like to make it as self-hosting solution, but unfortunately even though I followed the readme I was not able to succeed.
The problem I’ve encountered is that server is running and accepting incoming connections but dropping them almost immediately.
On server side I have a linux box with ubuntu server.
I’ve tried both dockerized version and “standard” one.
My run command is node -r esm ./bin/server --port 3000 --domain tun.sub.domain.com --secure true
// exact name has been changed to tun.sub.domain.com //
Added some log.debug’s and on the server side I got:
localtun_1 | [debug] server listening on port: 3000
localtun_1 | [debug] undefined
localtun_1 | [debug] tcp server listening on port: 42405
localtun_1 | [debug] removing client: mighty-skunk-48
localtun_1 | [debug] closed tcp socket
localtun_1 | [debug] closed tcp socket
localtun_1 | [debug] server listening on port: 3000
localtun_1 | [debug] undefined
localtun_1 | [debug] tcp server listening on port: 46035
localtun_1 | [debug] removing client: helpless-cougar-46
localtun_1 | [debug] closed tcp socket
localtun_1 | [debug] closed tcp socket
While on the client side // I have it behind nginx listening with SSL on port 3333 (config from your repo localtunnel-nginx) that’s why you see port 3333 on client side
✘ npx localtunnel --port 8000 --host https://tun.sub.domain.com:3333
your url is: https://mighty-skunk-48.tun.sub.domain.com:3333
but no traffic and /api/status
reply with {tunnels:0...}
✘ npx localtunnel --port 8000 --host https://tun.sub.domain.com:3333
your url is: https://helpless-cougar-46.tun.sub.domain.com:3333
but no traffic and /api/status
reply with {tunnels:0...}
Actually I’ve discovered that if I hit /api/status
fast enough I got reply with {tunnels:1...}
for a friction of a second.
Any ideas what’s wrong here? Thanks a lot!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
I had a similar issue. Turns out I had to open all the ports for my server in the network firewall as Client tries to connect to assigned port on the go.
I hope this helps!
Ok wow it turns out someone did think of this and somehow implemented it half way.
Step 1.
Change
./lib/server.js
add the ip flag:
&
Step 2.
Change
./server.js
in the same location as aboveThen make sure to add your explicit ip address with the
--address
flag:That’s it. Now it will work as expected. smh.