From f005c2b1f515954236cae2894c66abb847eee10b Mon Sep 17 00:00:00 2001 From: Hiroki Ohtani Date: Tue, 14 Oct 2014 09:25:02 +0900 Subject: [PATCH] fixed #118 get subprotocol. --- websocket/_core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/websocket/_core.py b/websocket/_core.py index f53f79b..88ae9db 100644 --- a/websocket/_core.py +++ b/websocket/_core.py @@ -359,6 +359,8 @@ class WebSocket(object): else: self.lock = NoLock() + self.subprotocol = None + def fileno(self): return self.sock.fileno() @@ -557,6 +559,7 @@ class WebSocket(object): if not subproto or subproto not in subprotocols: logger.error("Invalid subprotocol: " + str(subprotocols)) return False + self.subprotocol = subproto result = headers.get("sec-websocket-accept", None)