Skip to content
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

[Web] headers in HtmlWebSocketChannel? #156

Open
tusharsadhwani opened this issue Feb 20, 2021 · 1 comment
Open

[Web] headers in HtmlWebSocketChannel? #156

tusharsadhwani opened this issue Feb 20, 2021 · 1 comment

Comments

@tusharsadhwani
Copy link

Is there any way to provide headers to an HtmlWebSocketChannel? Right now it seems that only url and protocols are available right now.

I'm assuming this is because dart:html WebSocket doesn't allow you to do that, and I think flutter/flutter#39998 is the right place to ask about this, but is there some other thing that I'm missing?

@animeshjain
Copy link

It seems HTTP headers cannot be reliably depended upon (browser specific). So the only reliable option seems to be to establish a websocket connection and then exchange auth information in a handshake phase, before accepting any further packets.

Check this answer:
https://stackoverflow.com/questions/4361173/http-headers-in-websockets-client-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants