conn = new SockJS('http://' + window.location.host + '/sockjs/', transports, {debug: true});
async def chat_msg_handler(msg, session):
if msg.type == sockjs.MSG_OPEN:
session.manager.broadcast("Someone joined.")
elif msg.type == sockjs.MSG_MESSAGE:
session.manager.broadcast(msg.data)
elif msg.type == sockjs.MSG_CLOSED:
session.manager.broadcast("Someone left.")