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

Add support for remote forwarding (reverse tunneling) #59

Closed
suo opened this issue Aug 14, 2017 · 13 comments
Closed

Add support for remote forwarding (reverse tunneling) #59

suo opened this issue Aug 14, 2017 · 13 comments

Comments

@suo
Copy link

suo commented Aug 14, 2017

To repro (Mac only):

  1. Follow the instructions here to set up a pbcopy daemon that listens on port 2224. That article has steps for testing the daemon to make sure it is correctly receiving requests.
  2. Run EternalTerminal forwarding some port to 2224 on the local machine, e.g. et -t="2224:9999" <remote>:8080
  3. Observe wackiness.

To confirm that plain ssh works, you could run:

ssh <remote target> -R2224:localhost:2224

and try hitting the port:

echo asdf | nc -c localhost 2224

The expected behavior is that "asdf" is now copied to your system clipboard.

@MisterTea
Copy link
Owner

Ok I see the problem: this requires a remote forward, which is basically a tunnel in reverse. ET doesn't support this yet.

@MisterTea MisterTea changed the title Using -t with pbcopy daemon leads to <CR>s being eaten Add support for remote forwarding (reverse tunneling) Sep 1, 2017
@MisterTea
Copy link
Owner

There is a second issue where when tunneling fails, it b0rks your terminal.

@bkarlson
Copy link

bkarlson commented Oct 3, 2017

Any prospects on getting remote tunnels? I am trying to make work rsubl (i.e. rmate for Sublime) via roaming terminal, but both mosh and ET don't deliver in this area 😭
Thanks for great project!

@MisterTea
Copy link
Owner

@bkarlson We are working on implementing jump hosts now but once that is done we can take a look at reverse tunnels.

@tonidy
Copy link

tonidy commented Jan 14, 2018

Same problem with @bkarlson, I need to use rmate for VS Code via terminal. Any progress on this issue @MisterTea ?

Thanks

@MisterTea
Copy link
Owner

Sounds like this is the most needed feature that we don't already have :-). I should be able to code this up by next week.

@MisterTea
Copy link
Owner

You can track progress by following this branch: https://github.com/MisterTea/EternalTCP/tree/reverse_tunnel

@MisterTea
Copy link
Owner

Alright, I tested this on my machines and it seems to work. I need other people to test before I can merge this in with confidence. This means you @michaelsuo @tonidy @bkarlson et al :-)

Please checkout branch reverse_tunnel, build the latest commit of that branch, and replace your et and etserver binaries on both client & server with the ones you build. Then you should be able to use reverse tunneling with the -rt command.

So, for example, to have the server communicate with a pbcopy daemon listening on port 2224:

et -rt="4321:2224" (hostname:port)

Then anything that goes to localhost:4321 on the server will be received by 2224 on the local machine. You can also do 2224:2224, but I made up 4321 so the example is easier to read.

@MisterTea
Copy link
Owner

Implemented in latest master.

@joshuarubin
Copy link

This works great except that I have a RemoteForward option in my ~/.ssh/config that causes a port conflict when I also use et -rt. Can you cause et to always disable the RemoteForward option when calling ssh? It doesn't seem like it should ever be correct for it to be enabled in ssh when using et.

@joshuarubin
Copy link

It would also be amazing to, in addition to the above comment, automatically parse the RemoteForward option that ssh would have used and apply it as an et -rt option.

@frederickjh
Copy link

frederickjh commented Sep 5, 2019

@joshuarubin I think you should start a new issue for the ssh RemoteForward conflict as this one has been closed and I think it is important that this gets corrected.

@joshuarubin
Copy link

#228

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

6 participants