示例#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
示例#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
 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()
示例#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
示例#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) 
示例#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)
示例#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))
示例#8
0
 def __init__(self, allowed_address, *args, **kwargs):
     self.allowed_address = allowed_address
     HTTPFactory.__init__(self, *args, **kwargs)
示例#9
0
文件: http.py 项目: 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)
示例#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))
示例#12
0
 def __init__(self, allowed_address, *args, **kwargs):
     self.allowed_address = allowed_address
     HTTPFactory.__init__(self, *args, **kwargs)