aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/pathod.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-09-01 10:39:57 +0200
committerGitHub <noreply@github.com>2016-09-01 10:39:57 +0200
commit55d938b880fd861a22ac66da0da9a741bdd9abd5 (patch)
treed469bbd0dd5b1966591a332bf2094d4389100219 /pathod/pathod.py
parent281d779fa3eb6b81ec76d046337275c0a82eff46 (diff)
parent0d0c2c788df4b60e951e6fcc13b479de8cec22c1 (diff)
downloadmitmproxy-55d938b880fd861a22ac66da0da9a741bdd9abd5.tar.gz
mitmproxy-55d938b880fd861a22ac66da0da9a741bdd9abd5.tar.bz2
mitmproxy-55d938b880fd861a22ac66da0da9a741bdd9abd5.zip
Merge pull request #1488 from mitmproxy/websockets
add WebSockets support
Diffstat (limited to 'pathod/pathod.py')
-rw-r--r--pathod/pathod.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pathod/pathod.py b/pathod/pathod.py
index 7087cba6..bd0feb73 100644
--- a/pathod/pathod.py
+++ b/pathod/pathod.py
@@ -173,12 +173,13 @@ class PathodHandler(tcp.BaseHandler):
retlog["cipher"] = self.get_current_cipher()
m = utils.MemBool()
- websocket_key = websockets.WebsocketsProtocol.check_client_handshake(headers)
- self.settings.websocket_key = websocket_key
+
+ valid_websockets_handshake = websockets.check_handshake(headers)
+ self.settings.websocket_key = websockets.get_client_key(headers)
# If this is a websocket initiation, we respond with a proper
# server response, unless over-ridden.
- if websocket_key:
+ if valid_websockets_handshake:
anchor_gen = language.parse_pathod("ws")
else:
anchor_gen = None
@@ -225,7 +226,7 @@ class PathodHandler(tcp.BaseHandler):
spec,
lg
)
- if nexthandler and websocket_key:
+ if nexthandler and valid_websockets_handshake:
self.protocol = protocols.websockets.WebsocketsProtocol(self)
return self.protocol.handle_websocket, retlog
else: