Closed borisreitman closed 9 years ago
You can pass headers as the 5th argument of new WebSocket().
I haven't verified but something like this should work:
new WebSocket("ws://example.com/", null, null, null, "Header1: xxx\r\nHeader2: yyy\r\n");
I'm not sure, but this extra argument may cause error in native WebSocket. In that case, you must pass this argument only if Flash implementation is used.
Thanks, it works.
Because HttpOnly cookies can not be accessed by Flash, I would like to set extra cookies or extra headers using javascript, so that when the Upgrade request is made by Flash, I can get at those headers and authenticate the user. Please provide either a way to set a custom header, or to add more cookies. Let me know if this is not clear, and more explanation is needed.