WebSocket send extra information on connection

Posted by MattDiPasquale on Stack Overflow See other posts from Stack Overflow or by MattDiPasquale
Published on 2013-10-19T02:02:25Z Indexed on 2013/10/19 3:54 UTC
Read the original article Hit count: 183

Is there a way for a WebSocket client to send additional information on the initial connection to the WebSocket server?

I'm asking because I want the client to send the user ID (string) to the server immediately. I don't want the client to send the user ID in the onopen callback. Why? Because it's faster and simpler.

If the WebSocket API won't let you do this, why not? If there's no good reason, how could I suggest they add this simple feature?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about callback