first commit

This commit is contained in:
编码猿
2024-09-27 01:10:21 +08:00
commit 4bb91f7aa9
83 changed files with 952 additions and 0 deletions

24
test/wsc.py Normal file
View File

@@ -0,0 +1,24 @@
import asyncio
import socketio
sio = socketio.AsyncClient()
@sio.event
async def connect():
print('connection established')
@sio.event
async def my_message(data):
print('message received with ', data)
await sio.emit('my response', {'response': 'my response'})
@sio.event
async def disconnect():
print('disconnected from server')
async def main():
await sio.connect('http://localhost:8000')
await sio.wait()
if __name__ == '__main__':
asyncio.run(main())