Giter VIP home page Giter VIP logo

Comments (10)

inconshreveable avatar inconshreveable commented on August 18, 2024 1

@NerdYouDontKnow @radiospiel @rhomeister

This is now live on ngrok.com. Version 1.5 binaries are available on https://ngrok.com/download. If you just restart ngrok, your installation should auto-update.

Docs are on the website but it's simple enough to explain here. There's a new "remote_port" attribute you can specify in your configuration on tcp tunnels:

tunnels:
  ssh:
    remote_port: 60001
    proto:
      tcp: 22

Please be advised that on ngrok.com, you may only reserve ports 50000-65353. The rest are reserved for me =)

I'm not adding a way to do this on the command line unless there is sufficient interest. I'd prefer to leave the CLI as simple as possible.

from ngrok.

ndrewh avatar ndrewh commented on August 18, 2024

I have been told that this will be added this week

from ngrok.

inconshreveable avatar inconshreveable commented on August 18, 2024

@rhomeister @NerdYouDontKnow As promised: commit 98902cf

Leaving this open until I get a chance to write the docs + release new binaries.

from ngrok.

radiospiel avatar radiospiel commented on August 18, 2024

This looks awesome already, thanks! A few questions though:

  • is the server able to verify that a specific client (via its auth_token) is actually entitled to use the requested port? Ideally the ngrokd binary could be used to change the configuration of a running ngrokd process; but even a easily hackable custom configuration callback would probably suffice already.
  • from a look at the source I feel the server tries to forward to a randomly chosen port if the requested port is not available; I think it should just return an error in that case. It might be possible however that I just don't understand the source completely :)

from ngrok.

inconshreveable avatar inconshreveable commented on August 18, 2024

@radiospiel

Right now, there is no concept of a specific client being entitled to the requested port. I was planning on adding this to ngrok.com possibly as a paid feature for you to be able to reserve a domain/port that will be guaranteed never to be given to another user.

It would be really cool if ngrokd could be hot-reloaded or that there were an interface for customizing ngrokd's tunnel allocations. I'll take pull requests =)

The server will never assign you a random port if you ask for one specifically, the relevant code is here:
98902cf#diff-ce50bf6fa1855f8ac1439bedd572083aR131

The confusing code you saw is here:
98902cf#diff-ce50bf6fa1855f8ac1439bedd572083aR148

That log message should read: Failed to get cached port %d: %v, trying a random one. Ports get cached so that when you reconnect (either purposefully or when the network goes down), if you asked for a random port ngrokd makes a best effort to give you back the one you used previously, but obviously no guarantees.

from ngrok.

ndrewh avatar ndrewh commented on August 18, 2024

So when will this be available on ngrok.com?

On Oct 18, 2013, at 4:50 PM, inconshreveable [email protected] wrote:

@radiospiel

Right now, there is no concept of a specific client being entitled to the requested port. I was planning on adding this to ngrok.com possibly as a paid feature for you to be able to reserve a domain/port that will be guaranteed never to be given to another user.

It would be really cool if ngrokd could be hot-reloaded or that there were an interface for customizing ngrokd's tunnel allocations. I'll take pull requests =)

The server will never assign you a random port if you ask for one specifically, the relevant code is here:
98902cf#diff-ce50bf6fa1855f8ac1439bedd572083aR131

The confusing code you saw is here:
98902cf#diff-ce50bf6fa1855f8ac1439bedd572083aR148

That log message should read: Failed to get cached port %d: %v, trying a random one. Ports get cached so that when you reconnect (either purposefully or when the network goes down), if you asked for a random port ngrokd makes a best effort to give you back the one you used previously, but obviously no guarantees.


Reply to this email directly or view it on GitHub.

from ngrok.

radiospiel avatar radiospiel commented on August 18, 2024

@inconshreveable sorry for my late reply. I finally found the time to work with ngrokd on a custom project and to revisit this issue. Thank you for your explanation, I will see how I fare.

from ngrok.

j3ffgray avatar j3ffgray commented on August 18, 2024

Question regarding the remote port. Those are shared amongst all ngrok users, is it not? So, I can attempt to have a service run this, but if someone is already using that port, it will fail. Is there a way to use subdomain instead, so that there isn't a possibility for collision?

from ngrok.

inconshreveable avatar inconshreveable commented on August 18, 2024

At the moment, no, that's not possible.

from ngrok.

j3ffgray avatar j3ffgray commented on August 18, 2024

Okay thanks!

from ngrok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.