[feature] Deploy to heroku #88

Closed
opened 2018-04-20 23:33:42 +00:00 by GabLeRoux · 5 comments
GabLeRoux commented 2018-04-20 23:33:42 +00:00 (Migrated from github.com)

Hi there,
I'm leaving this here mostly for documentation in case someone else has the same idea.

I was playing around and thought I could deploy localtunnel/server to heroku. I gave it a try (mostly for fun) and first had troubles trying to run ./bin/server due to ❗️shebang❗️

#!/usr/bin/env node -r esm

It was failing with this 💥:

/usr/bin/env: 'node -r esm': No such file or directory

I managed to work around this by using node -r esm ./bin/server in package.json + using PORT env var for heroku 👍 and got the server running (one can click on 'Deploy to heroku' button on my gableroux/server fork to give a try).

The problem

your_application_name.herokuapp.com responds just fine, but the generated tunnel doesn't work because localtunnel relies on subdomains. In other words, the app will try to use some-random-name.your_application_name.herokuapp.com.

As explained in the readme:

In order to run your own localtunnel server you must ensure that your server can meet the following requirements:

You can set up DNS entries for your domain.tld and *.domain.tld (or sub.domain.tld and *.sub.domain.tld).
[...]

Example

lt -h https://your_application_name.herokuapp.com -p 8000
your url is: http://chatty-skunk-96.your_application_name.herokuapp.com

404, There's nothing here, yet.

A possible solution

Use heroku custom domains with wildcard domain!

I gave it a try, but it turns out you need a pro account or paid runners to get SSL support so I did not go much further.

You need to be running on either Hobby or Professional dynos to be able to use SNI SSL.

Feel free to close this issue ✌️

Hi there, I'm leaving this here mostly for documentation in case someone else has the same idea. I was playing around and thought I could deploy `localtunnel/server` to [heroku](https://dashboard.heroku.com/). I gave it a try (mostly for fun) and first had troubles trying to run `./bin/server` due to ❗️shebang❗️ ```bash #!/usr/bin/env node -r esm ``` It was failing with this 💥: > /usr/bin/env: 'node -r esm': No such file or directory I managed to work around this by using `node -r esm ./bin/server` in `package.json` + using `PORT` env var for heroku 👍 and got the server running (one can click on 'Deploy to heroku' button [on my gableroux/server fork](https://github.com/gableroux/server) to give a try). ## The problem `your_application_name.herokuapp.com` responds just fine, but the generated tunnel doesn't work because localtunnel relies on subdomains. In other words, the app will try to use `some-random-name.your_application_name.herokuapp.com`. As explained in the readme: > In order to run your own localtunnel server you must ensure that your server can meet the following requirements: > > You can set up DNS entries for your `domain.tld` and `*.domain.tld` (or `sub.domain.tld` and `*.sub.domain.tld`). > [...] ### Example ```bash lt -h https://your_application_name.herokuapp.com -p 8000 your url is: http://chatty-skunk-96.your_application_name.herokuapp.com ``` > 404, There's nothing here, yet. ## A possible solution Use [heroku custom domains](https://devcenter.heroku.com/articles/custom-domains) with wildcard domain! I gave it a try, but it turns out you need a pro account or paid runners to get SSL support so I did not go much further. > You need to be running on either Hobby or Professional dynos to be able to use SNI SSL. Feel free to close this issue :v:
defunctzombie commented 2018-04-22 00:32:18 +00:00 (Migrated from github.com)

Localtunnel server will not work on a platform like heroku because the architecture leverages tcp connections (beyond port 80 and 443) to the individual localtunnel clients. I have thought about using a websocket protocol for this and multiplexing the http packets within it however this would be quite an architectural change that I do not have time to pursue right now. Until that happens it will not be possible to run on platforms like heroku.

Thanks for trying it out tho and posting your findings!

Localtunnel server will not work on a platform like heroku because the architecture leverages tcp connections (beyond port 80 and 443) to the individual localtunnel clients. I have thought about using a websocket protocol for this and multiplexing the http packets within it however this would be quite an architectural change that I do not have time to pursue right now. Until that happens it will not be possible to run on platforms like heroku. Thanks for trying it out tho and posting your findings!
thisismydesign commented 2020-03-07 21:57:35 +00:00 (Migrated from github.com)

Would it be possible to create a stripped version that only supports a single client on the main domain and port? Then everyone could use that to have a self-hosted service on Heroku.

Would it be possible to create a stripped version that only supports a single client on the main domain and port? Then everyone could use that to have a self-hosted service on Heroku.
aleclarson commented 2020-04-03 20:02:16 +00:00 (Migrated from github.com)

@defunctzombie Could Heroku+Docker work?

@defunctzombie Could [Heroku+Docker](https://devcenter.heroku.com/articles/container-registry-and-runtime) work?
defunctzombie commented 2020-04-04 05:30:28 +00:00 (Migrated from github.com)

@aleclarson Heroku won't work with the current design because they won't let you listen on arbitrary tcp ports which are used for the inbound tunnels from localtunnel cli.

@aleclarson Heroku won't work with the current design because they won't let you listen on arbitrary tcp ports which are used for the inbound tunnels from localtunnel cli.
yashwanth2714 commented 2023-12-20 09:59:26 +00:00 (Migrated from github.com)

Which platform should I use for deployment?

I have tried services such as Render, Vercel, Heroku, and Railway.

Which platform should I use for deployment? I have tried services such as Render, Vercel, Heroku, and Railway.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hoelee/server#88