Exemplo n.º 1
0
 def __init__(self):
     HTTPFactory.__init__(self)
     # We track all sub-protocols for response channel mapping
     self.reply_protocols = {}
     # Make a factory for WebSocket protocols
     self.ws_factory = WebSocketServerFactory("ws://127.0.0.1:8000")
     self.ws_factory.protocol = WebsocketProtocol
     self.ws_factory.reply_protocols = self.reply_protocols
Exemplo n.º 2
0
 def __init__(self):
     HTTPFactory.__init__(self)
     # We track all sub-protocols for response channel mapping
     self.reply_protocols = {}
     # Make a factory for WebSocket protocols
     self.ws_factory = WebSocketServerFactory("ws://127.0.0.1:8000")
     self.ws_factory.protocol = WebsocketProtocol
     self.ws_factory.reply_protocols = self.reply_protocols
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     """
     @TODO: what happens if the connection is closed? 
            (I don't believe cups.Connection is holding open a persistent
            connection, but this will need to be verified)
     """
     HTTPFactory.__init__(self, *args, **kwargs)
     
     self._connection = cups.Connection()
Exemplo n.º 4
0
 def __init__(self, dbpool, cfg=None, wmscfg=None):
     HTTPFactory.__init__(self)
     self.dbpool = dbpool
     self.CFG = cfg
     self.WMSCFG = wmscfg
     proxy = cfg.get('proxy', None) # 'proxy' is required, but we
                                    # use .get for safety
     if proxy:
         self.proxy = urlparse.urlparse(proxy)
     else:
         self.proxy = None
Exemplo n.º 5
0
    def __init__(self, logPath=None, timeout=60*60*12, restrictedToPort=443): 
        """ 
        @param logPath: The same as for HTTPFactory. 
        @param timeout: The same as for HTTPFactory. 
 
        @param restrictedToPort: Only CONNECT requests to this port number 
            are allowed.  This may be None, in which case any port 
            is allowed. 
        @type restrictedToPort: C{int} or None 
        """ 
        assert restrictedToPort is None or type(restrictedToPort) is int, 'Invalid restrictedToPort value: %r' % (restrictedToPort,) 
 
        self.restrictedToPort = restrictedToPort 
        HTTPFactory.__init__(self, logPath, timeout) 
Exemplo n.º 6
0
    def __init__(self,
                 logPath=None,
                 timeout=60 * 60 * 12,
                 restrictedToPort=443):
        """ 
        @param logPath: The same as for HTTPFactory. 
        @param timeout: The same as for HTTPFactory. 
 
        @param restrictedToPort: Only CONNECT requests to this port number 
            are allowed.  This may be None, in which case any port 
            is allowed. 
        @type restrictedToPort: C{int} or None 
        """
        assert restrictedToPort is None or type(
            restrictedToPort) is int, 'Invalid restrictedToPort value: %r' % (
                restrictedToPort, )

        self.restrictedToPort = restrictedToPort
        HTTPFactory.__init__(self, logPath, timeout)
Exemplo n.º 7
0
 def __init__(self):
     HTTPFactory.__init__(self)
     #self.agent = client.Agent(reactor, pool = client.HTTPConnectionPool(reactor))
     self.agent = client.Agent(reactor, pool = SlowPool(reactor))
Exemplo n.º 8
0
 def __init__(self, allowed_address, *args, **kwargs):
     self.allowed_address = allowed_address
     HTTPFactory.__init__(self, *args, **kwargs)
Exemplo n.º 9
0
Arquivo: http.py Projeto: 18sg/SHET
	def __init__(self, shet):
		self.shet = shet
		HTTPFactory.__init__(self)
 def __init__(self, logPath=None, timeout=60*60*12):
     HTTPFactory.__init__(self, logPath,timeout)
Exemplo n.º 11
0
 def __init__(self):
     HTTPFactory.__init__(self)
     #self.agent = client.Agent(reactor, pool = client.HTTPConnectionPool(reactor))
     self.agent = client.Agent(reactor, pool=SlowPool(reactor))
Exemplo n.º 12
0
 def __init__(self, allowed_address, *args, **kwargs):
     self.allowed_address = allowed_address
     HTTPFactory.__init__(self, *args, **kwargs)