slact / nchan

Fast, horizontally scalable, multiprocess pub/sub queuing server and proxy for HTTP, long-polling, Websockets and EventSource (SSE), powered by Nginx.
https://nchan.io/
Other
2.99k stars 292 forks source link

Authentication via message #663

Open KamranBiglari opened 1 year ago

KamranBiglari commented 1 year ago

Is there any possibility of using the message body for authentication instead of the header? I want my client to connect to the WebSocket and send the login command and if the login was successful send the command for subscribing to the channel.

Login command:

{"command":"login","username":"USERNAME","password":"PASSWORD"}

Subscribe command:

{"command":"subscribe","channel":"CHANNEL_NAME"}
bublikOff commented 1 year ago

You can try to use alternative events stream code (JavaScript) ... for eg I do auth over jwt token in url