26 comments

[ 18.2 ms ] story [ 740 ms ] thread
I find that documentation very difficult to understand.
Why not start a Tor Onion service instead? I believe there are similar turn-key solutions for that as well.
That’s not remotely the same use case, nor is Tor something most want to use in their networks unless it is absolutely needed.
That's an underrated suggestion! However, even if configured as a single-hop service Tor would add substantial latency and bandwidth restrictions, and would not support UDP. But Tor would not require the user to self-host external infrastructure so could be used in a pinch where this (or more canonical ssh -R) couldn't.
Could you explain the goal of this, and how it actually attains this? It just doesn't seem clear what the client and server are here, nor what the "local server" is behind that needs piercing.

Is this to, say, expose a server sitting behind a NAT to the rest of the world, or...?

I'm not the author, but I _think_ this is similar to what you can do via "ssh -R" (SSH remote port forwarding) - but generalised to UDP too.

Scenario:

- You have a Linode VM running, accessible to everyone on the Internet

- You run Mr.2 server on this Linode VM

- On your home laptop (behind NAT), you run Mr.2 client, pointing it at your Mr.2 server on the Linode VM

- Now, from anywhere in the world, you can connect to your home laptop via the Linode server

... I think.

Worst Show HN ever?
No. Someone took the time to build something that solved a need and then shared it, thinking it might help other people.

There's nothing bad about this whatsoever.

(comment deleted)
Ok, I'm not sure about this, but looking at the explanation it looks like something like ngrok[0], serveo[1] or Argo Tunnel[2].

So basically it's a program for server & client that allows exposing a local server to the net (usually) for development purposes.

Install mr2 on the server & client, you can use the mr2 program in the client to expose the web server running in the client through the server (with mr2 installed).

[0] https://ngrok.com

[1] http://serveo.net

[2] https://developers.cloudflare.com/argo-tunnel/quickstart/

UDP support implies QUIC, right? Would that be a differentiator vs eg ngrok?
I don't care about my karma level, and don't like commenting about downvotes per sensible guidelines...

but I genuinely don't understand this.

I asked an honest simple real relevant question (still wd love an answer), but most ppl can't see my question bc it's at 0. /complaint

(comment deleted)
Can this be a library instead of a standalone executable?

I can imagine a lot of end-user P2P applications where this, as a library, would be a great help.

I need it in library form as well. It can get tricky sometimes learning the ins and outs of sockets on various platforms, so it would be great to have C bindings to open the port in a standard cross-platform way. Currently it supports:

https://github.com/txthinking/mr2#download

    Download OS Arch
    mr2 Linux amd64
    mr2_darwin_amd64 MacOS amd64
    mr2_windows_amd64.exe
https://github.com/txthinking/mr2/releases

    mr2, mr2_darwin_amd64, mr2_freebsd_386, mr2_freebsd_amd64, mr2_linux_386, mr2_linux_arm5, mr2_linux_arm6, mr2_linux_arm64, mr2_linux_arm7, mr2_linux_mips, mr2_linux_mips64, mr2_linux_mips64le, mr2_linux_mipsle, mr2_linux_mipsle_sf, mr2_linux_mips_sf, mr2_linux_ppc64, mr2_linux_ppc64le, mr2_windows_386.exe, mr2_windows_amd64.exe
Also random question, but, does anyone know of a lightweight cross-platform tool to wrap any console executable within a library? Like a mini container or Docker except it would inherit the parent OS so there would be no base platform. The parent application would just see C bindings to the STDIN/STDOUT/STDERR streams and possibly an array of shared directories/permissions, and/or anything else that a console app typically communicates through. Sorry if this is a dumb question (I've only used Docker and Vagrant for specific use cases and am not an expert on the theory behind containers).
How does that differ from

    $ ssh -R2345:localhost:80 user@example.com
And then going to example.com:2345 (if you want to e.g. forward HTTP)? I mean you need a remote node anyway for that to work?
I'd guess UDP support and form.
Looks like this is using GPL - if companies want something they can use for commercial purposes, checkout https://inlets.dev which is on the CNFC Landscape and also has a deep Kubernetes integration through its operator. https://github.com/inlets/inlets-operator
This is an application, companies can use it commercially the same way you can use bash.
This is using GNU General Public License v3.0 which means commercial purposes are allowed, no?
Every version of the GPL allows commercial use.
Even AGPL allows commercial use, but you'd have to release the source code to modifications used to serve network resources. The bog-standard GPL doesn't even require that for this usecase.
I think the description would be clearer if it talked about port forwarding from a remote server to your local machine. After all "expose local server" is normally just about binding to 0.0.0.0 instead of loopback.