def __init__(self, sock, addr, new_websocket_client, web_root="/usr/share/xpra/www/"): self.web_root = web_root self._new_websocket_client = new_websocket_client server = AdHocStruct() server.logger = log server.run_once = True server.verbose = WEBSOCKET_DEBUG WebSocketRequestHandler.__init__(self, sock, addr, server)
def __init__(self, sock, addr, new_websocket_client, web_root="/usr/share/xpra/www/", script_paths={}, disable_nagle=True): self.web_root = web_root self._new_websocket_client = new_websocket_client self.script_paths = script_paths server = AdHocStruct() server.logger = log server.run_once = True server.verbose = WEBSOCKET_DEBUG self.disable_nagle_algorithm = disable_nagle WebSocketRequestHandler.__init__(self, sock, addr, server)
def end_headers(self): #magic for querying request header values: path = getattr(self, "path", "") if path.endswith("?echo-headers"): #ie: "en-GB,en-US;q=0.8,en;q=0.6" accept = self.headers.get("Accept-Language") if accept: self.send_header("Echo-Accept-Language", std(accept, extras="-,./:;=")) if HTTP_NOCACHE: self.send_nocache_headers() WebSocketRequestHandler.end_headers(self)
def finish(self): if self.notify_socket is not None: self.notify_socket.close() WebSocketRequestHandler.finish(self)
def end_headers(self): if HTTP_NOCACHE: self.send_nocache_headers() WebSocketRequestHandler.end_headers(self)