From fe5a660c805aed3cdb68409053cd50779e5fc4e7 Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Wed, 15 Aug 2018 08:37:06 +0200 Subject: [PATCH] update websocket headers --- uwebsockets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uwebsockets.py b/uwebsockets.py index 5aac760..5ce1b3c 100644 --- a/uwebsockets.py +++ b/uwebsockets.py @@ -212,11 +212,11 @@ def connect(uri): # WebSocket initiation headers headers = [ - b'GET / HTTP/1.1', + b'GET %s HTTP/1.1' % uri.path or '/', b'Upgrade: websocket', b'Connection: Upgrade', - b'Host: ws.achex.ca:4010', - b'Origin: http://ws.achex.ca:4010', + b'Host: %s:%s' % (uri.hostname, uri.port), + b'Origin: http://%s:%s' % (uri.hostname, uri.port), b'Sec-WebSocket-Key: ' + key, b'Sec-WebSocket-Version: 13', b'',