示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 def finish(self):
     if self.notify_socket is not None:
         self.notify_socket.close()
     WebSocketRequestHandler.finish(self)
示例#6
0
 def end_headers(self):
     if HTTP_NOCACHE:
         self.send_nocache_headers()
     WebSocketRequestHandler.end_headers(self)