WebSocket framework writtein in Python.
Works standalone but is preferred as @upgrader
for slimHTTP.
- slimWS documentation
- slimWS via slimHTTP's discord server
pip install slimWS
git submodule add -b master https://github.com/Torxed/slimWS.git
(Or just git clone https://github.com/Torxed/slimWS.git
)
Most examples will be found under the documentation, but here's a quick one.
from slimWS import slimws
server = slimws.host(address='', port=4001)
@server.frame
def parse_frame(self, frame):
print('Got WebSocket frame:', frame.data)
yield {'status' : 'successful'}
while 1:
for event, *event_data in server.poll():
pass