localtunnel / localtunnel

expose yourself
https://localtunnel.me
MIT License
19.08k stars 1.34k forks source link

Keep running even if server is offline #466

Open TechStudent10 opened 2 years ago

TechStudent10 commented 2 years ago

I am using localtunnel with Flask and when using a development server, the server temporarily goes offline to restart if changes are detected.

Localtunnel goes offline when the server goes offline. Now, every single time I change a file, I need to rerun. Localtunnel is the easiest way for me to create tunnels. This (localtunnel going offline when the server restarts) is the only problem.

Is there anyway to disable this behavior?

TechStudent10 commented 2 years ago

localtunnel keeps running and you don't need to restart it.

In my experience, it just stops running altogether.

TechStudent10 commented 2 years ago

Um why did the person delete their comment?

mgeissen commented 2 years ago

I have the same issue.

For me as workaround, I had another local proxy that is forwarding the localtunnel port to my local development server. Then I'm able to restart my server without losing the localtunnel connection, because the proxy is still up and running. I'm using http-simple-proxy for that.

TechStudent10 commented 2 years ago

I have the same issue.

For me as workaround, I had another local proxy that is forwarding the localtunnel port to my local development server. Then I'm able to restart my server without losing the localtunnel connection, because the proxy is still up and running. I'm using http-simple-proxy for that.

Ah, thanks. I'll try this out for myself later.

LSAfrika commented 2 years ago

@mgeissen thanks for the solution in kind csn you show me how this is done step by step since am lost even after looking at http proxy would want to see how you set it up to work with LT

leopucci commented 1 year ago

npm install -g http-proxy put on a sh file

#!/bin/bash
http-proxy -p 8001 3004&
sleep 2
lt --port 8001 --subdomain mysubdomain

3004 is the destination port, change to yours.

so basically it receives the request on the 8001 proxy and sends to 3004 port.

Marvin-Brouwer commented 7 months ago

I had these same issues with AstroJS when building. Currently working on a rebuild, where a proxy is included. I'm probably ready for the first release somewhere next week. Although I just made raw http server so I don't think websockets are supported yet.

Let me know if you're interested.

mhmdjaw commented 5 months ago

npm install -g http-proxy put on a sh file

#!/bin/bash
http-proxy -p 8001 3004&
sleep 2
lt --port 8001 --subdomain mysubdomain

3004 is the destination port, change to yours. so basically it receives the request on the 8001 proxy and sends to 3004 port.

where can I find the list of commands? how do I stop the job?