DEV Community

How I built Ngrok Alternative

Azimjon Pulatov on July 09, 2020

Here's a quick intro of what I built Ngrok is a fantastic tool that helps developers to expose their localhost to the Internet with minimal eff...
Collapse
 
coolaj86 profile image
AJ ONeal (formerly @solderjs)

I also have an open source alternative, in node.js: telebit.io

I'm in the process of transitioning to Go (because node's TCP stack was sooooo terrible and sooo buggy), but I'm not quite ready to publish it.

(although if I were to rewrite it in node today, most of the bugs that made it extremely difficult have since been fixed)

I went with the end-to-end encrypted model, and my choice to tunnel multiple connections within websockets was... challenging. Doing one-per-each may have been a better choice. The jury is till out.

My explanation: stackoverflow.com/a/52614266/151312

Collapse
 
azimjohn profile image
Azimjon Pulatov

Recently someone used jprq for phishing. First Google Chrome started showing "deceptive site" banner then the domain was suspended. I am still looking at ways to prevents this from happening again.

I was wondering if you have had any experience with dealing with those issues? I recently found out about github.com/publicsuffix/list and found telebit.io there and can it solve this problem?

Collapse
 
coolaj86 profile image
AJ ONeal (formerly @solderjs) • Edited

P.S. That would be a good thread to post a new answer with a link to your article.

Collapse
 
anderspitman profile image
Anders Pitman

I've been trying to find that SO answer forever. I remember reading it a while back, specifically the part about e2e encryption. Would have been useful when I was working on e2e for boringproxy.

Collapse
 
medboo profile image
medboo

Great work even though I was not able to use it and here is my 2 cents on this as an end-user:

You did the hard work already, but you skipped the easiest (the most important should I say)?

1) Write the instructions on how to self-host the server, I uploaded the code to my server and tried to access the url, but got "Tunnel doesn't exist", I have no idea what this is, with a little extra effort to write some human instructions you will save me and others a lot of time and headaches.

2) for the client part, write the lines you described in the video in the github README as well, there is no easiest way than copy/past, it's much faster than the short video itself :)

Might seem not that important to us as coders, but when you become the end-user you pay attention to how much these little things matter.

Good luck

Collapse
 
__asam12__ profile image
Julius Novachrono🇳🇬🇳🇬

If you use Ngrok's yaml config file you can expose 2 ports on the free plan

Collapse
 
anderspitman profile image
Anders Pitman • Edited

See also this list of 30+ ngrok alternatives and similar tools: github.com/anderspitman/awesome-tu...

Collapse
 
abdisalan_js profile image
Abdisalan

awesome post! I use ngrok regularly, so it was cool to see it from this persepective

Collapse
 
wulymammoth profile image
David

Nice work! I've been using ngrok before it became a service. Did you reference its source code to write it in Python?

Collapse
 
azimjohn profile image
Azimjon Pulatov

Hi David, I didn't reference Ngrok's source code.
I had a simpler vision and I built it out from scratch.

Collapse
 
ulugbekna profile image
Ulugbek Abdullaev

Impressive! Could you elaborate on what memory leaks you had with goroutines?