Skip to content

Best way to authorize a client started in a browser with the server #125

Answered by enisdenjo
airhorns asked this question in Q&A
Discussion options

You must be logged in to vote

Hey there! The client connectionParams option is what you're seeking.

It allows you to pass a payload with the ConnectionInit message. ConnectionInit MUST be the first message that the connection transmits, and should therefore be used for authorization. In addition to this, there is a specific timeout within which the client MUST send this message to the server, if the server does not receive it in time - it will close the connection with a: 4408: Connection initialisation timeout. Read more about the ConnectionInit message in the Protocol.

On the server-side, use the onConnect option to authenticate the connection and respond accordingly.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by airhorns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants