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 = []
예제 #2
0
 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)
예제 #3
0
 def __init__(self, *args, **kwargs):
     self.uuid = str(uuid.uuid1())
     self.resplength = 0
     self._mybuffer = []
     self.encoding = ''
     self.ctype = ''
     self.headers_to_cache = {}
     self.commands = dict()
     ProxyClient.__init__(self, *args, **kwargs)
     print(self.uuid + " args:")
     pprint(self.father.args)
예제 #4
0
    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 = []
예제 #5
0
    def __init__(self, uuid, *args, **kwargs):
        self.uuid = uuid
        self.logDebug("__init__", "Called")
        self.resplength = 0
        self._mybuffer = []
        self.encoding = ''
        self.ctype = ''
        self.headers_to_cache = {}
        self.commands = dict()
        ProxyClient.__init__(self, *args, **kwargs)
        self.logDebug(
            "__init__",
            "ARGS: " + pprint.pformat(self.father.args, width=99999999))

        self.logDebug("__init__", "done")
예제 #6
0
 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 = ''
예제 #7
0
 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)
예제 #8
0
    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')
예제 #9
0
    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')
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.image_parser = None
 def __init__(self, command, rest, version, headers, data, father):
     ProxyClient.__init__(self, command, rest, version, headers, data, father)
예제 #12
0
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.rewrite = False
     self.length = None
     self.buffer = ''
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.image_parser = None
예제 #14
0
 def __init__(self, *args, **kwargs):
     self.buf = ""
     self.gziped = False
     ProxyClient.__init__(self, *args, **kwargs)
 def __init__(self, command, rest, version, headers, data, father):
     ProxyClient.__init__(self, command, rest, version, headers, data,
                          father)
 def __init__(self, *args, **kwargs):
     self.buf = ""
     self.gziped = False
     ProxyClient.__init__(self, *args, **kwargs)
예제 #17
0
 def __init__(self, *args, **kwargs):
     ProxyClient.__init__(self, *args, **kwargs)
     self.image_parser = None
     self.ctype_received = False
     self.clength = 0