-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Websockets fail to connect #101
Comments
Request headers:
Response headers:
|
Have you ensured that WebSockets are enabled with |
Nope, I have not, but I'd expect the app to crash with an error and definitely not silently ignore that. I implore you to add a check for it. |
Still though, the warnings about headers are still there, even after I've added |
Might be relevant dotnet/aspnetcore#33502 |
@AntonC9018, it's interesting. ASP.NET does not crash in this scenario either. I think the philosophy is that the routing middleware is just that: it is routing middleware. If you have routing middleware that catches web socket requests, and no requests come in because it is not "turned on", then the middleware just doesn't do anything. I would prefer to keep similar behavior with ASP.NET. As for the the headers, those are kestrel warnings. I am guessing that your browser is sending those headers, and kestrel is informing you that they will be stripped for |
As much as I don't agree with that philosophy, fair enough. As for the headers, yes, I'm aware of that now, check out the issue I had linked. |
@twitchax Do you plan on fixing the unfiltered header warnings? |
The plain HTTP requests work, however websockets fail to connect.
This is the error that I see in the browser console that attempts to establish the connection:
The relevant code:
I'm not seeing a websocket request being sent to the endpoint in the server console, but I do see a multiple of these quite suspicious logs:
I don't know much about HTTP headers, but they might be related to this. Maybe I just need to enable some of these https://content-security-policy.com/
Also, the request used HTTP/1.1, but ASP.NET Core seems to be expecting HTTP/2 or /3, which may or may not matter.
I'm on .NET 6.
The text was updated successfully, but these errors were encountered: