當前位置: 首頁>>代碼示例>>Python>>正文


Python ProxyClient.__init__方法代碼示例

本文整理匯總了Python中twisted.web.proxy.ProxyClient.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python ProxyClient.__init__方法的具體用法?Python ProxyClient.__init__怎麽用?Python ProxyClient.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在twisted.web.proxy.ProxyClient的用法示例。


在下文中一共展示了ProxyClient.__init__方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
    def __init__(self, *args, **kwargs):
        ProxyClient.__init__(self, *args, **kwargs)
        self.overrides = []
        self.restricted_headers = [
            'accept-charset',
            'accept-encoding',
            'access-control-request-headers',
            'access-control-request-method',
            'connection',
            'content-length',
            'cookie',
            'cookie2',
            'content-transfer-encoding',
            'date',
            'expect',
            'host',
            'keep-alive',
            'origin',
            'referer',
            'te',
            'trailer',
            'transfer-encoding',
            'upgrade',
            'user-agent',
            'via'
            ]

        self.all_headers = []
        self.unsent_restricted_headers = []
開發者ID:tobiashochguertel,項目名稱:postman-proxy_server.py,代碼行數:31,代碼來源:proxy_server.py

示例2: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, *args, **kwargs):
     self._buffer = []
     self.encoding = ''
     self.ctype = ''
     self.reencode = True
     self.replace = False
     self.headers_to_cache = {}
     ProxyClient.__init__(self,*args,**kwargs)
開發者ID:habedi,項目名稱:rproxy,代碼行數:10,代碼來源:rproxy.py

示例3: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.replacing = None
     self.rewriting = None
     self._buf = None
     cache_path = cache_file(self.father.uri)
     replace_path = replace_file(self.father.uri)
     if cache_path and not os.path.exists(cache_path):
         t = threading.Thread(target=lambda:urllib.urlretrieve(self.father.uri, cache_path))
         t.start()
     if replace_path:
         self.replacing = replace_path
     elif 'json/Level' in self.father.uri and self.father.uri.endswith('.json'):
         self.rewriting = True
         self._buf = ''
開發者ID:thouis,項目名稱:works-in-progress,代碼行數:17,代碼來源:prox2.py

示例4: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, command, rest, version, headers, data, father, resource):
    father.notifyFinish().addErrback(self._clientfinished, father, resource)
    if "proxy-connection" in headers:
       del headers["proxy-connection"]
    headers["connection"] = "close"
    headers.pop('keep-alive', None)
    self.headers = headers
    log.debug("Proxy Client SEND headers: "+str(headers))
    ProxyClient.__init__(self,
                        command=command,
                        rest=rest,
                        version=version,
                        headers=headers,
                        data=data,
                        father=father)
開發者ID:,項目名稱:,代碼行數:17,代碼來源:

示例5: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
    def __init__(self, command, rest, version, headers, data, request):
        """
        Override ProxyClient.__init__ to:
            1. Set client HBModuleRegistry
            2. Set an intercept buffer
            3. Set an intercept header
            4. Set transaction_id

        """

        ProxyClient.__init__(self, command, rest, version, headers, data,
                             request)
        self.module_registry = request.module_registry
        self.buffer = ""
        self.header = {}
        now = datetime.datetime.now()
        self.father.response_createdAt = now.strftime('%Y-%m-%d %H:%M:%S')
開發者ID:KorayAgaya,項目名稱:HeliosBurn,代碼行數:19,代碼來源:http.py

示例6: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, *args, **kwargs):
     self.buf = ""
     self.gziped = False
     ProxyClient.__init__(self, *args, **kwargs)
開發者ID:yknx4,項目名稱:UnlockNeteaseMusicProxy,代碼行數:6,代碼來源:netease_music_proxy.py

示例7: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, command, rest, version, headers, data, father):
     ProxyClient.__init__(self, command, rest, version, headers, data, father)
開發者ID:freedesktop-unofficial-mirror,項目名稱:SyncEvolution__syncevolution,代碼行數:4,代碼來源:proxy.py

示例8: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.rewrite = False
     self.length = None
     self.buffer = ''
開發者ID:isotoma,項目名稱:badgerproxy,代碼行數:7,代碼來源:proxyclient.py

示例9: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.image_parser = None
開發者ID:tobiashochguertel,項目名稱:postman-proxy_server.py,代碼行數:5,代碼來源:twisted-proxy.py

示例10: __init__

# 需要導入模塊: from twisted.web.proxy import ProxyClient [as 別名]
# 或者: from twisted.web.proxy.ProxyClient import __init__ [as 別名]
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.image_parser = None
     self.ctype_received = False
     self.clength = 0
開發者ID:Eeko,項目名稱:resizer_proxy,代碼行數:7,代碼來源:compressproxy.py


注:本文中的twisted.web.proxy.ProxyClient.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。