当前位置: 首页>>代码示例>>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;未经允许,请勿转载。