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

How to specify a port to tunnel to #91

Closed
victormazeli opened this issue Apr 17, 2023 · 2 comments
Closed

How to specify a port to tunnel to #91

victormazeli opened this issue Apr 17, 2023 · 2 comments

Comments

@victormazeli
Copy link

i want achieve this same functionality when i use ngrok via ssh; like so : ngrok http 3000 how can i achieve this using this package.

a little peek from the node js ngrok library; i can achieve this by doing this const url = await ngrok.connect(9090);.

i would appreciate if i can be pointed to in the right direction on how to achieve this.

@euank
Copy link
Contributor

euank commented Apr 18, 2023

The ngrok-lite example in this repo shows a way to do it with this library.

In that example, dest in net.Dial("tcp", dest) would be localhost:3000 to achieve the same thing as ngrok http 3000 does.

Since this is a pretty common pattern, we're planning to add built-in support to make it a bit easier, though no promises on exactly when.
@jrobsonchase has a draft up over in #74 if you want to try it out and see if it works for your use-case though

@inconshreveable
Copy link
Contributor

This functionality was added a while ago with the ListenAndForward call, docs here: https://pkg.go.dev/golang.ngrok.com/ngrok#ListenAndForward

closing as fixed

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

3 participants