[英]Connecting to Jabber Server Via Proxy in Python (XMPPY)
嘗試使用代理連接到jabber:
> JCON = xmpp.Client(server=SERVER, port=PORT, debug=[])
> con=JCON.connect(server=(CONNECT_SERVER, PORT), proxy=(127.0.0.1, 80), secure=0,use_srv=True)
沒有代理,它連接良好。 代理語法正確嗎? 在XMPPY( https://github.com/normanr/xmpppy/blob/master/xmpp/client.py )中引用'Client.py'可能有助於理解語法。
希望能盡快得到答復!
從您鏈接的代碼:
“ proxy”參數是帶有強制鍵“ host”和“ port”(代理地址)的字典
您需要像這樣將其更改為字典。
con=JCON.connect(server=(CONNECT_SERVER, PORT), proxy={'host':'127.0.0.1', 'port':'80'}, secure=0,use_srv=True)
如果需要身份驗證,可以在字典中添加'user':'me','password':'secret',例如
con=JCON.connect(server=(CONNECT_SERVER, PORT), proxy={'host':'127.0.0.1', 'port':'80','user':'me','password':'secret'}, secure=0,use_srv=True)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.