From bb2045b719259de3c613223fb267bcc59be6e333 Mon Sep 17 00:00:00 2001 From: Nils G <nils.gondermann@ruhr-uni-bochum.de> Date: Fri, 17 Apr 2020 15:14:29 +0200 Subject: [PATCH] Use the same protocol to send websocket packets as we do to serve the website --- modules/websocket_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/websocket_util.py b/modules/websocket_util.py index 17007da..151fa74 100644 --- a/modules/websocket_util.py +++ b/modules/websocket_util.py @@ -4,7 +4,7 @@ from gluon.contrib.websocket_messaging import websocket_send from http_util import GET_HOST def WEBSOCKET_SEND(_room, _type, _data): - websocket_send('http://127.0.0.1:8888', _data, '67c371fd204fbcbf9742310d1a9d951bcca1aa86', _room.code) + websocket_send(current.request.env.wsgi_url_scheme + '://127.0.0.1:8888', _data, '67c371fd204fbcbf9742310d1a9d951bcca1aa86', _room.code) def GET_URL(_room): if current.request.env.wsgi_url_scheme == "https": @@ -12,4 +12,4 @@ def GET_URL(_room): else: protocol = "ws" - return(protocol+"://"+GET_HOST()+":8888/realtime/"+_room.code) + return(protocol + "://" + GET_HOST() + ":8888/realtime/" + _room.code) -- GitLab