connects to sbs chat and serves in its stead (persistent session, multiple clients at once)
- python 3.4+
- websockets library
- modify the addresses in main.py as you see fit (lines 12 and 102)
- add this to your chatJS:
if(hasSpecial("socketOverload")){
polyChat.onClose=onClose;
polyChat.onError=onError;
polyChat.onMessage=onMessage;
polyChat.webSocketURL = "ws:https://127.0.0.1:8765";
polyChat.start(document.getElementsByTagName('body')[0].getAttribute('data-uid'),document.getElementsByClassName('chat')[0].getAttribute('data-chatauth'))
activePingId=window.setInterval(activePing,45000);
window.addEventListener('focus',activePing);
}
- add "socketOverload" to your special field
- modify the second to last line of main.py and the webSocketURL in the chatJS to match and fit your situation
4a. this means that you might have to change line 163 websockets.serve(handler,"localhost",8765)
to websockets.serve(handler,port=8765)
it holds a connection with sbs chat and serves it to chat clients, even multiple at once.
regular chat clients can connect to this by changing the address they connect to, which is what the setup above does.