Subject: Re: [hybi] WS close code equivalent to HTTP 500/Internal Server Error

From: Alexey Melnikov <[email-masked]>
Date: Tue, 29 Nov 2011 14:18:51 +0000

Peter Thorson wrote:
> This issue came up while polishing up the error handling code for my WS implementation. There doesn't seem to be a websocket close code equivalent to HTTP 500/Internal server error.
>
> I would like to handle situations where my endpoint catches an internal logic error and knows that continuing the connection will probably result in bad/unknown behavior but knows that it is safe enough to close the connection cleanly.
>
> Example: I am a server and my handler for processing websocket messages is interpreted code and that code has a syntax error. The websocket server itself is fine and can safely close the connection but clearly cannot process messages until someone fixes the missing semicolon somewhere. In an HTTP server I would return 500/Internal Server error to indicate that something on the server end screwed up and that there is probably more information in the server log files to diagnose further.
>
> None of the current close codes (except 1006/abnormal closure - which isn't allowed on the wire) really fit. I'd rather not just drop the connection uncleanly/send back empty close frame since that provides no information about what happened and makes figuring out whose logs I should be looking at as an end application developer difficult. Browsers only report the status code itself and not the reason so sending a normal/going away error code with a more specific reason is less helpful. What are other implementations doing in this case? Would another close code for internal server error make sense?
Let's use 1011 for this (Unless I already suggested it be used for 
something else. Please correct me if I did.):

1011
       1011 indicates that a server is terminating the connection
       because it has encountered an unexpected condition which prevented
       it from fulfilling the request.

---

From: Peter Thorson <[email-masked]>
Date: Tue, 29 Nov 2011 08:54:50 -0600

A quick search through the hybi list logs indicates code 1011 has only been mentioned in relation to this error condition.

On Nov 29, 2011, at 8:18 , Alexey Melnikov wrote:

> Let's use 1011 for this (Unless I already suggested it be used for something else. Please correct me if I did.):
> 
> 1011

---

From: Greg Wilkins <[email-masked]>
Date: Wed, 30 Nov 2011 09:45:48 +1100

>      it from fulfilling the request.

+1

what is the process path from here?    Do we have any other changes needed?

---

From: Peter Saint-Andre <[email-masked]>
Date: Tue, 29 Nov 2011 16:31:59 -0700

On 11/29/11 3:45 PM, Greg Wilkins wrote:
> what is the process path from here? 

This code (and a few others) will be slipped into the spec during "AUTH48":

http://www.rfc-editor.org/pubprocess.html#auth48

>   Do we have any other changes needed?

Some slight editorial issues, registration process clarifications, and
the close codes that have been discussed on the list. Alexey and Ian can
provide more details.

Peter

-- 
Peter Saint-Andre
https://stpeter.im/

---

From: Salvatore Loreto <[email-masked]>
Date: Wed, 30 Nov 2011 07:41:17 +0100

wfm

/Sal

On 11/29/11 3:18 PM, Alexey Melnikov wrote:
> _______________________________________________
> hybi mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/hybi
>