Пример #1
0
    def __init__(self, req, addr, server):
        # Retrieve a few configuration variables from the server
        self.only_upgrade = getattr(server, "only_upgrade", False)
        self.verbose = getattr(server, "verbose", False)
        self.daemon = getattr(server, "daemon", False)
        self.record = getattr(server, "record", False)
        self.run_once = getattr(server, "run_once", False)
        self.rec = None
        self.handler_id = getattr(server, "handler_id", False)
        self.file_only = getattr(server, "file_only", False)
        self.traffic = getattr(server, "traffic", False)

        self.logger = getattr(server, "logger", None)
        if self.logger is None:
            self.logger = WebSockifyServer.get_logger()

        WebSocketRequestHandler.__init__(self, req, addr, server)
Пример #2
0
    def __init__(self, req, addr, server):
        # Retrieve a few configuration variables from the server
        self.only_upgrade = getattr(server, "only_upgrade", False)
        self.verbose = getattr(server, "verbose", False)
        self.daemon = getattr(server, "daemon", False)
        self.record = getattr(server, "record", False)
        self.run_once = getattr(server, "run_once", False)
        self.rec        = None
        self.handler_id = getattr(server, "handler_id", False)
        self.file_only = getattr(server, "file_only", False)
        self.traffic = getattr(server, "traffic", False)

        self.logger = getattr(server, "logger", None)
        if self.logger is None:
            self.logger = WebSockifyServer.get_logger()

        WebSocketRequestHandler.__init__(self, req, addr, server)
Пример #3
0
 def finish(self):
     if self.rec:
         self.rec.write("'EOF'];\n")
         self.rec.close()
     WebSocketRequestHandler.finish(self)
Пример #4
0
    def handle_upgrade(self):
        # ensure connection is authorized, and determine the target
        self.validate_connection()

        WebSocketRequestHandler.handle_upgrade(self)
Пример #5
0
    def handle_upgrade(self):
        # ensure connection is authorized, and determine the target
        self.validate_connection()

        WebSocketRequestHandler.handle_upgrade(self)