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

Feature Request: socket tunneling like ngrok #66

Open
TimothyFitz opened this issue Mar 26, 2019 · 6 comments
Open

Feature Request: socket tunneling like ngrok #66

TimothyFitz opened this issue Mar 26, 2019 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@TimothyFitz
Copy link

Using Magic Wormhole as a replacement for tools like ngrok, to tunnel raw sockets and/or HTTP traffic, would be really useful.

From a cursory glance at the underlying implementation, this seem doable on top of the existing model.

@piegamesde
Copy link
Member

I think tunneling a TCP port over to another machine should be doable. This would probably use a new APPID with its own custom little client-client protocol. This then needs to initialize the transit tunnel. The only thing to figure out there is who is "sender" and who is "receiver", as there is no such concept in a bidirectional tunnel.

All of this gives us a TCP connection, but I don't know how to expose it as "tunnel" to the OS.

@TimothyFitz I don't know ngrok, what is your exact use case? The only tunneling I've ever done was over SSH, and I don't know why I'd ever need something else.

@piegamesde piegamesde added the help wanted Extra attention is needed label Jan 11, 2021
@dylanmc
Copy link

dylanmc commented Jan 26, 2021

I hadn't heard of ngrok - neat little function, and yeah, it seems like this should be free & do-able. One question: what would the public IP of the tunneled socket be?

@piegamesde
Copy link
Member

I don't know if I understand correctly, but there should be no public IP address, only localhost.

@dylanmc
Copy link

dylanmc commented Jan 27, 2021

One of the main cool things ngrok does is make a local service available externally. In ngrok's case, it's via a unique hostname in a domain they control (on their screen-demo it's katesapp.ngrok.io). I was wondering what @TimothyFitz was suggesting for the public IP of his feature request would be. If it's to be run on the wormmole server, that's more heavy lifting on the server side than wormhole currently does, but maybe I'm wrong - that it's basically the same. I don't yet understand how the rendezvous / network connection mechanism works.

@piegamesde piegamesde changed the title Feature Request: socket tunneling Feature Request: socket tunneling like ngrok Jan 27, 2021
@piegamesde
Copy link
Member

I see that there are two different concepts and use cases here, so I've split up the issue into #109. Let's talk about ngrok-like features only here.

@piegamesde
Copy link
Member

We now have an experimental implementation of port forwarding merged. Please give it a try and provide feedback. If you have an interesting use case for this, consider sharing it and I'll add it to the documentation eventually. Notable port forwarding setups that have already been tried (more or less successfully):

  • "Open to LAN" Minecraft Server, but across the internet
  • Interactively sharing parts of a folder hierarchy with miniserve
  • Ad-hoc web server testing
  • Tmux/TTY screen sharing
  • Rsync between machines that don't SSH
  • SSH between machines that otherwise can't reach each other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants