我正在尝试用我尝试过的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'
pyngrok
的开发人员。上面的注释中给出了正确的Python代码段,我也将其发布在此处,以便可以将其标记为已回答。您无法将此参数直接传递给connect()
,因此,您需要将其作为options
字典传递给connect()(它将在您的文档中解压缩到隧道定义中已链接-请参阅API文档here)。