-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for additional HTTP headers in Websocket connection #856
Comments
I don't think that's currently supported. Would you like to send a PR? |
I took a quick look at the code, and it looks like a limitation of the underlying 'websocket-stream' library used to create the WebSocket connection. In fact, it appears to be a restriction of the native |
I spent a day digging deep into getting an AWS IoT custom authorizer working, which requires custom Websockets HTTP headers. In short I stumbled upon this issue where AWS employee @AWSSteveHa confirms several times that it can't be done from browsers because of limitations in the underlying Websocket implementation: aws/aws-iot-device-sdk-js#169
Ohh! Any hints how to make that work? Would be really interesting digging into the "how" there.. |
To send the headers in the connect request, please try installing a modified websocket-stream library. I've modified websocket-stream to pass through headers when supplied in the options (for a React Native project). |
Hi, i'm interested in this feature and after some testing i can say that:
|
This is an automated message to let you know that this issue has If this issue is still important, you can simply comment with a Thank you for your contribution. |
This issue was automatically closed due to inactivity. |
Hi,
I'm trying to add additional authentication headers in the initial HTTP connection request, but using option
wsOptions
does not seem to add additional headers:If there is currently a way to do this, it'd be great if the documentation explicitly stated it. If not, I'd greatly appreciate support for this feature. Thanks a lot!
Rafael
The text was updated successfully, but these errors were encountered: