Set websocket close reason
dbrgn opened this issue · comments
When closing due to a protocol error, the server emits the following log (example):
[2016-10-31 16:52:36.572995] NOTICE: saltyrtc.path.142.client.7f9c1786fa08: Closing due to protocol error: Invalid ping interval
The WebSocket close event that I receive on the client side looks like this:
{
code: 3001,
reason: "",
// ...
}
Would it be possible to add the reason text to the close event, or do you think that might be a security issue?
The client side should just translate the error code into text. I don't think setting a reason text is helpful. And furthermore, you already named it, it might introduce security issues we want to avoid.
The client side should just translate the error code into text.
Protocol error
is very generic :)
I don't think setting a reason text is helpful
I do, in this case it helped me to find the actual source of the protocol error.
it might introduce security issues we want to avoid
That might be true. Feel free to close if you think it's better to avoid sending the reason.
I'd be OK with sending a reason text in an explicitly set debug mode. That would require quite some changes though...
@dbrgn Have you ever explicitly required this for debugging? I think the server log should be sufficient for tracing client behaviour bugs (since you usually control both). I'm marking it as wontfix
because of that.
If one would have to turn on debug mode in the server, then that person can just as well look at the debug log I guess.