miguelgrinberg / Flask-SocketIO-Chat

A simple chat application that demonstrates how to structure a Flask-SocketIO application.
http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent
MIT License
676 stars 242 forks source link

Example code with Auth key at the time of connect #38

Closed rmControls closed 3 months ago

rmControls commented 2 years ago

Thank you for sharing the great example of Flask-SocketIO....

I am trying to get authentication token at the time of connect, can you update your sample code with passing Authkey at the time of connect??

miguelgrinberg commented 2 years ago

This example does not require authentication. You can look at the documentation for the Socket.IO JS client, and the Python server to see how to pass authentication.

Client docs: https://socket.io/docs/v4/client-api/#iourl Server docs: https://python-socketio.readthedocs.io/en/latest/server.html#connect-and-disconnect-event-handlers