Skip to content

Commit

Permalink
#2104 compatiblity up to '​Separate out raw WebSocket protocol handli…
Browse files Browse the repository at this point in the history
…ng' changeset

git-svn-id: https://xpra.org/svn/Xpra/trunk@21460 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jan 23, 2019
1 parent 8c363eb commit 204b9f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/xpra/server/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
if not WEBSOCKIFY_NUMPY:
WebSocketRequestHandler.unmask = unmask
except ImportError:
from websockify.websockifyserver import WebSockifyRequestHandler as WebSocketRequestHandler
from websockify.websocketserver import WebSocketRequestHandler
if not WEBSOCKIFY_NUMPY:
WebSocketRequestHandler._unmask = unmask
#patch WebSocket class so we always choose binary
#(why isn't this the default!?)
from websockify.websocket import WebSocket
WebSocket.select_subprotocol = lambda _self,_protocols: "binary"
log("WebSocketRequestHandler=%s", WebSocketRequestHandler)
#print warnings except for numpy:
for x in w:
Expand All @@ -55,6 +59,7 @@


WEBSOCKET_DEBUG = envbool("XPRA_WEBSOCKET_DEBUG", False)
WEBSOCKET_ONLY_UPGRADE = envbool("XPRA_WEBSOCKET_ONLY_UPGRADE", False)
HTTP_ACCEPT_ENCODING = os.environ.get("XPRA_HTTP_ACCEPT_ENCODING", "br,gzip").split(",")


Expand All @@ -74,10 +79,12 @@ def __init__(self, sock, addr, new_websocket_client, web_root="/usr/share/xpra/w
server.logger = log
server.run_once = True
server.verbose = WEBSOCKET_DEBUG
self.only_upgrade = server.only_upgrade = WEBSOCKET_ONLY_UPGRADE
self.disable_nagle_algorithm = disable_nagle
WebSocketRequestHandler.__init__(self, sock, addr, server)

def new_websocket_client(self):
log("new_websocket_client() calling %s, request=%s (%s)", self._new_websocket_client, self.request, type(self.request))
self._new_websocket_client(self)

def translate_path(self, path):
Expand Down

0 comments on commit 204b9f2

Please sign in to comment.