-
Notifications
You must be signed in to change notification settings - Fork 537
Fixed SockJS closure with correct close status code #811
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
Conversation
Signed-off-by: francesco <[email protected]>
we also need to handle the EventBusBridge#checkCallHook method basically wherever the EB bridge closes the socket we need to check which code to use |
What do you think about 1002? "1002 indicates that an endpoint is terminating the connection due to a protocol error." |
The close call you are talking about is called after the bridge rejected the socket connection right? In this case maybe is better 1011 "The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request." or 1013 "The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients." (found here: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent ) |
@pmlopes any opinion on the code to use ? |
@slinkydeveloper @vietj regarding the code, i can't find a clear reference that states which code to use, but it seems that 1001 is ok as the eventbus is going away. Regarding the |
@pmlopes for the new API, the status code has only meaning for Websocket and does not have for other transports... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to test the case of invalid message, the client sends an invalid message that force the connection to be closed by the bridge
Investigating a bit inside sockjs-client it seems that both status code and reason are handled by client APIs, but it's not clear how they are transported with transports different from Websocket. |
for other transport, we just close like we do today. |
Can you add the handling for protocol error @slinkydeveloper ? |
@vietj any tips on how test it? |
Signed-off-by: francesco <[email protected]>
# Conflicts: # vertx-web/src/main/java/io/vertx/ext/web/handler/sockjs/impl/EventBusBridgeImpl.java
As explained here #809 and here #804