ngrok-python icon indicating copy to clipboard operation
ngrok-python copied to clipboard

Add `labels` as a named parameter of `ngrok.forward` method

Open jimkring opened this issue 1 year ago • 2 comments

I was mentioned in this issue/comment that it's possible to use the labels keyword argument with the ngrok.forward method (e.g. ngrok.forward("localhost:8080", proto="labeled", labels="edge:edghts_2G...", authtoken_from_env=True)), which is great for specifying a specific edge for creating a tunnel.

It would be helpful to users if labels was an named parameter of the ngrok.forward method (rather than just supporting it as a keyword argument that works if you know it exists.

Thanks!

jimkring avatar Jan 04 '24 20:01 jimkring

For a more concrete style the builder pattern configuration can be used, here's an example of that which is more explicit: ngrok-labeled.py

bobzilladev avatar Jan 04 '24 21:01 bobzilladev

My concern here is what creating a named parameter is that it could create problems for users who are not creating tunnel backends (i.e. using endpoints instead of edges). We'll do some investigation to see if we can work around that but if not, we'll keep the behavior as is.

salilsub avatar Feb 22 '24 23:02 salilsub