Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ngrok with tunnelmole for twilio-run #477

Open
robbie-cahill opened this issue Jun 12, 2023 · 2 comments
Open

Replace ngrok with tunnelmole for twilio-run #477

robbie-cahill opened this issue Jun 12, 2023 · 2 comments

Comments

@robbie-cahill
Copy link

To generate public URLs, twilio-run uses the unofficial ngrok dependency from npm. This dependency has a few issues:

  • As noted in the README for ngrok, its simply a wrapper around the ngrok CLI tool. So, you must download and install the ngrok CLI tool as an external dependency and this complicates setup
  • You need to manually match the version of the ngrok dependency to specific versions of the ngrok CLI client, further complicating setup. You are using version 3.x for twilio-run, its not the latest 5.x version and it does not appear to be documented what ngrok CLI client versions it supports.
  • The npm dependency is maintained by a third party and is not officially supported by ngrok. So, ngrok could make some unexpected change and the integration might break suddenly.
  • The ngrok CLI tool is not FOSS and is closed source. For some projects, this could create licensing issues if the maintainers are not ok with that for whatever reason.

I propose replacing ngrok with tunnelmole. Tunnelmole is open source and the runtime is implemented in pure JavaScript.

You only need to add it as an npm dependency and you don't need to install anything separately. npm automatically manages all dependencies, you don't need to manually match up versions of anything.

As the runtime code is pure JavaScript, it is automatically cross platform and will run on all operating systems and CPU architectures that NodeJS can run on.

To compare usage:
ngrok
First, download and install ngrok from ngrok.com, or this won't work. Also, ensure your version of the ngrok CLI tool is compatible with the version of the ngrok NPM dependency you are using.

const url = await ngrok.connect(3000);

tunnelmole

const url = await tunnelmole({ port: 3000 });

This works right away, without installing anything separately. It should be fairly straightforward to refactor your code to use tunnelmole.

Let me know if you'd like to move ahead and i'll create a PR with the changes.

@welcome
Copy link

welcome bot commented Jun 12, 2023

Thank you so much for opening your first issue in this project! We'll try to get back to it as quickly as possible. While you are waiting...here's a random picture of a corgi (powered by dog.ceo)

picture of dog

@makserik
Copy link
Contributor

Hi @robbie-cahill while replacing ngrok with your open-source alternative seems simple, we have a lot of guides (eg. https://www.twilio.com/en-us/blog/6-things-you-can-do-with-twilio-serverless-toolkit) that would also need to be changed then. We also need to ensure that for our customers the process does not get more difficult (for example having to download the self-hosting server).

Therefore I do not see us doing this change any time soon.

@makserik makserik added this to the Improvements/Nice to haves milestone Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants