Closed andre2007 closed 3 years ago
Nope I never implemented that. I did cookies but not extra headers.
Very simple add though.... I just pushed to master, I didn't even test though but if you wanna give it a try and let me know it should be ok.
Config config;
config.additionalHeaders ~= "Authorization: whatever";
auto socket = new WebSocket(Uri("ws://whatever"), config);
/* all the rest the same */
Thanks a lot, it works fine.
There is actually an socket error "Socket select error: An invalid argument was supplied" while awaiting a binary message, but this is unrelated to this issue. I will open a separate issue when I can provide you more details.
I want to use the Websocket class to connect to a websocket server. The server expects that the client sends a bearer token in http header
Authorization
. As far as I can see, there is no way to pass arbitrary http headers to the WebSocket class. Could you check whether you can add this functionality?