-
Notifications
You must be signed in to change notification settings - Fork 768
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
Allign websocket sending close codes with RFC #1642
Comments
Autobahn is supposed to support all valid WebSocket standard close codes, and I believe the code is written
and tested accordingly |
Hi @oberstet,.
From the first look i might be the difference, that I want to SEND the close code and your code is for RECEIVING close codes. I will look into that on Monday. |
Hi @oberstet, I think my first look was right. You where pointing at receiving close codes and I had problems with sending close codes. I am also was able to specify a "minimal" Testcase. I took the test
sendClose method from 10 to 1012.
I would say, that following test must success (but it doesnt) def test_sendClose_invalid_code_value_1012(self):
self.protocol.sendClose(code=1012) Also the interface description states that the close code must be "
As described above this matches with the implementation in autobahn-python/autobahn/websocket/protocol.py Line 2054 in f38f16b
Ich would also say, that to list of acceptable close codes for sending and receiving should be the same. As pointed out by you, they are already listed in
and checked at
I changed the topic name to match my description. I think I now have everything together, I have some residual doubts since this is the first time I look that close into this implementation. |
Hi everyone,
I use
autobahn
withdaphne
/Django
for a websocket application.We got a usecase where we disconnect the client and reset the connection. To show this in the log files and properly us another reconnect strategy, we decided to use different websocket close codes. (e.g. 1012; Service Restart). We realized that this codes are not supported by daphne (django/daphne#374). After looking around in the code I realized that this is implemented in the in this project.
Code: https://github.com/crossbario/autobahn-python/blob/master/autobahn/websocket/protocol.py#L2054
I am not sure why not all close codes are supported. Even the linked document in the code (https://www.iana.org/assignments/websocket/websocket.xml#close-code-number-rules) list all close codes.
Is there any reason why the close codes 1001-2999 are not supported? I think at least the defined codes 1000-1015 should be supported like described in the document.
I would create a MR, but the code look like this is intentional. :-)
Kind Regards
Sören
The text was updated successfully, but these errors were encountered: