python wsdl.proxy在HTTP代理后面



我有一个简单的代码,当我不落后于任何代理时,但是当我在代理后面时不起作用。因此,我有什么办法可以指定连接必须通过WSDL.Proxy类构造函数中的http_proxy建立?我一直在尝试iDeone.py。

您必须将以下补丁应用于 ideone.py

diff --git a/ideone.py b/ideone.py
index fffdf27..b15abef 100644
--- a/ideone.py
+++ b/ideone.py
@@ -42,10 +42,10 @@ def getError(response):

 class IdeOne:
-    def __init__(self, user='test', password='test'):
+    def __init__(self, user='test', password='test', **kwargs):
         self._user = user
         self._password = password
-        self._wsdlObject = WSDL.Proxy('http://ideone.com/api/1/service.wsdl')
+        self._wsdlObject = WSDL.Proxy('http://ideone.com/api/1/service.wsdl', **kwargs)
     def testFunction(self):
         response = self._wsdlObject.testFunction(self._user, self._password)

这将允许将关键字参数传递给WSDL.Proxy,该参数将用于创建其内部Client.SOAPProxy实例。 Client.SOAPProxy具有http_proxy关键字参数,因此,在应用补丁后,IdeOne(user='test', password='test', http_proxy='the.http.proxy')应起作用。

最新更新