ngrok-python
ngrok-python copied to clipboard
Add `labels` as a named parameter of `ngrok.forward` method
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!
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
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.