[python和ngrok带有选项给我一个错误

问题描述 投票:0回答:1

我正在尝试用我尝试过的ngrok运行options

from pyngrok import ngrok
ngrokPublicUrl = ngrok.connect(5000, bind_tls= True)

ngrokPublicUrl = ngrok.connect(remote_addr=5000, bind_tls= True)

关于选项,我在这里使用了文档-> https://ngrok.com/docs#tunnel-definitions。我正在尝试获取https地址而不是http。看来options用法不正确?

但我收到此错误

TypeError: connect() got an unexpected keyword argument 'remote_addr'

TypeError: connect() got an unexpected keyword argument 'bind_tls'
python ngrok
1个回答
0
投票
我是pyngrok的开发人员。上面的注释中给出了正确的Python代码段,我也将其发布在此处,以便可以将其标记为已回答。

您无法将此参数直接传递给connect(),因此,您需要将其作为options字典传递给connect()(它将在您的文档中解压缩到隧道定义中已链接-请参阅API文档here)。

© www.soinside.com 2019 - 2024. All rights reserved.