Skip to content

Add support for remote forwarding (reverse tunneling) #59

Closed

Description

@suo

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.

Activity

  1. MisterTea commented on Sep 1, 2017

    @MisterTea
    Owner

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

  2. changed the title [-]Using -t with pbcopy daemon leads to <CR>s being eaten[/-] [+]Add support for remote forwarding (reverse tunneling)[/+] on Sep 1, 2017
  3. MisterTea commented on Sep 1, 2017

    @MisterTea
    Owner

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

  4. bkarlson commented on Oct 3, 2017

    @bkarlson

    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!

  5. MisterTea commented on Oct 3, 2017

    @MisterTea
    Owner

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

  6. tonidy commented on Jan 14, 2018

    @tonidy

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

    Thanks

  7. MisterTea commented on Jan 18, 2018

    @MisterTea
    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.

  8. MisterTea commented on Jan 18, 2018

    @MisterTea
    Owner
  9. MisterTea commented on Jan 18, 2018

    @MisterTea
    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.

  10. MisterTea commented on Jan 30, 2018

    @MisterTea
    Owner

    Implemented in latest master.

  11. joshuarubin commented on Mar 21, 2019

    @joshuarubin

    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.

  12. joshuarubin commented on Mar 21, 2019

    @joshuarubin

    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.

  13. frederickjh commented on Sep 5, 2019

    @frederickjh

    @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.

  14. joshuarubin commented on Sep 5, 2019

    @joshuarubin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions