Open just4give opened 7 years ago
+1
For anyone interested, looking on the source, there is a second parameter protocols? which allows sending information. This information will be passed as a header Sec-WebSocket-Protocol with the values needed.
Then, you only need to pass the second parameter in the constructor like this: new $WebSocket( url, [ access_token, refresh_token ] );
This will cause the connection to fail on "Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received", if the server does not respond back with the same protocols. Details: stackoverflow.com
Hi there, Is there any way to pass Authorization header? My backend is secured by OAuth2 and Socket connection failing with 401.