-
Notifications
You must be signed in to change notification settings - Fork 858
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
Proxy Failure on WS Proxy Server Connection Close #44
Comments
Thanks for reporting the issue. Looks like the default error handler doesn't take care off WebSocket errors... (only http) |
The main issue is when a WebSocket is established and an error occurs in the scenerio you described; the error-handler currently responds by returning a I'm hoping @mjrussell might be more knowledgeable on how to handle WebSocket errors properly, since I'm not really sure. Summing up the information I've encountered: karma
w3 / mdn mdn
rfc6455
|
@chimurai nice summary! I would think that the proxy should just let the connection terminate, which I guess would be I wouldn't expect the middleware to send an extra code or anything in the socket that the server itself didn't send, especially because sometimes people may run their own protocol/codes inside the socket. The client side should be able to handle this as an unexpected error in the onError callback. I do also like the extra logging done in the karma proxy |
@mjrussell can you verify if this patch fixes the issue? |
@chimurai will do tomorrow, thanks for working this! |
That would be great! I kept the changes tiny, so I won't disturb the current functionality too much. Maybe I'll refactor error handling for version 1.0, so it will have proper error handling and logging. |
published fix in v0.9.1 |
HTPM just got merged into webpack(webpack/webpack-dev-server#359) which is awesome because it enables things like native websockets which didn't work previously.
I was just taking it for a spin and everything was working great until I took down the backend server before shutting down the dev-server. The logic in my front-end is such that after the socket dies it will recheck if it is logged in (hence the /api/users/me check). I can work on an example but it may take me a little while, wondering if it might be obvious from these logs + stack trace:
Im totally expecting the proxy to fail and even loudly complain, but I wouldn't expect it to crash the dev-server. If there's some hardening that must be done on the webpack-dev-server itself instead we can get a PR there.
The text was updated successfully, but these errors were encountered: