miguelgrinberg / flask-sock

Modern WebSocket support for Flask.
MIT License
274 stars 24 forks source link

[Question] - custom events+CORS #2

Closed jorgealves closed 3 years ago

jorgealves commented 3 years ago

Hi I'm currently developing a chatbot that I would like to know how should I configure WebSocket using your package when I have custom events for the same namespace and how flask-sock handlers that

Another question is how WebSocket receives new connections and validates CORS policy so it won't block any connection after the handshake? Could this be integrated with flask-cors package?

Thanks in advance

miguelgrinberg commented 3 years ago

What do you mean when you say "events" and "namespace"? Do you want to use WebSocket or Socket.IO? This is a WebSocket extension, it just gives you a connection. If you want something more high-level, check out my Flask-SocketIO extension.

Flask-CORS should be able to handle your WebSocket route(s).

jorgealves commented 3 years ago

What do you mean when you say "events" and "namespace"? Do you want to use WebSocket or Socket.IO? This is a WebSocket extension, it just gives you a connection. If you want something more high-level, check out my Flask-SocketIO extension.

Flask-CORS should be able to handle your WebSocket route(s).

Nevermind, you've clarified what i was doing wrong. Thanks for the help! Not sure if the community would like to have more info about this but you can consider this issue as solved.

Sorry about any unclarified info I gave to this issue since this is my very first issue opened in an open-source project