Skip to content
Snippets Groups Projects
Commit bb2045b7 authored by Nils G.'s avatar Nils G.
Browse files

Use the same protocol to send websocket packets as we do to serve the website

parent 2699f792
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ from gluon.contrib.websocket_messaging import websocket_send ...@@ -4,7 +4,7 @@ from gluon.contrib.websocket_messaging import websocket_send
from http_util import GET_HOST from http_util import GET_HOST
def WEBSOCKET_SEND(_room, _type, _data): 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): def GET_URL(_room):
if current.request.env.wsgi_url_scheme == "https": if current.request.env.wsgi_url_scheme == "https":
...@@ -12,4 +12,4 @@ def GET_URL(_room): ...@@ -12,4 +12,4 @@ def GET_URL(_room):
else: else:
protocol = "ws" protocol = "ws"
return(protocol+"://"+GET_HOST()+":8888/realtime/"+_room.code) return(protocol + "://" + GET_HOST() + ":8888/realtime/" + _room.code)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment