slimWS

WebSocket API engine.

GPL-3.0 License

Downloads
30
Stars
3
Committers
2

WebSocket framework writtein in Python. Works standalone but is preferred as @upgrader for slimHTTP.

Installation

pypi

pip install slimWS

Git it to a project

git submodule add -b master https://github.com/Torxed/slimWS.git 

(Or just git clone https://github.com/Torxed/slimWS.git)

Usage

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
Package Rankings
Top 32.02% on Pypi.org