aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/pathod.py
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-08-16 18:31:50 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-09-01 09:57:18 +0200
commite5b0dae7e9ef8d2ce62fc263c377c76546190825 (patch)
treed3b7257cfb0a0e66e2e7176f9d32bc16d820e618 /pathod/pathod.py
parentd12515f84b32b3157fa99ac3c3a7a7318f9626ba (diff)
downloadmitmproxy-e5b0dae7e9ef8d2ce62fc263c377c76546190825.tar.gz
mitmproxy-e5b0dae7e9ef8d2ce62fc263c377c76546190825.tar.bz2
mitmproxy-e5b0dae7e9ef8d2ce62fc263c377c76546190825.zip
add websockets support to mitmproxy
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: