python-socketio

How to emit message from python server to javascript client in python-socketio?

风流意气都作罢 提交于 2021-02-08 08:24:38
问题 The socketio client successfully connects to the server and sends messages with emit to the server but the other direction server to the client fails. I cannot find the source of error. It is Here is the server python in app.py based on the example in python-socketio website: from aiohttp import web import socketio sio = socketio.AsyncServer() app = web.Application() sio.attach(app) async def index(request): """Serve the client-side application.""" with open('index.html') as f: return web

Can't use nginx as websocket proxy

烈酒焚心 提交于 2019-12-11 14:53:39
问题 Here is my nginx config server { listen 80; server_name _; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://flask:8001; } location /socket.io { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy