ngrok / ngrok-python

Embed ngrok secure ingress into your Python apps with a single line of code.
https://ngrok.com
Apache License 2.0
103 stars 19 forks source link

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

Open jimkring opened 6 months ago

jimkring commented 6 months ago

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!

bobzilladev commented 6 months ago

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

salilsub commented 4 months ago

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.