[whatwg] WebSocket sub protocol name.

Fumitoshi Ukai (鵜飼文敏) ukai at chromium.org
Mon Dec 7 21:17:18 PST 2009


On Mon, Dec 7, 2009 at 7:25 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Mon, 7 Dec 2009, Fumitoshi Ukai (�µ~\飼æ~V~Gæ~U~O) wrote:
> > On Mon, Dec 7, 2009 at 5:05 PM, Ian Hickson <ian at hixie.ch> wrote:
> > > On Mon, 7 Dec 2009, Fumitoshi Ukai (榈~\椋兼~V~G鎫U~O) wrote:
> > > > > > >
> > > > > > > Control characters are allowed (though using them would be
> > > > > > > silly).
> > > > > >
> > > > > > Why are control characters (except LF and CR) allowed?
> > > > >
> > > > > There doesn't seem to be a good reason to exclude them, and
> > > > > excluding them would lead to a more complicated processing model.
> > > >
> > > > In HTTP, field-content is TEXT or combinations of token, separators,
> > > > and quoted-string. TEXT, or token, separators excludes CTLs. So, we
> > > > must use quoted-string in WebSocket-Protocol: if protocol contains
> > > > CTLs?
> > >
> > > Oh, I forgot that HTTP had the no-CTL restriction. Good point. I've
> > > updated the spec to be consistent with this.
> >
> > In "The Web Sockets API", could you fix the following statement?
> >   The second, protocol, if present, specifies a sub-protocol that the
> server
> > must support for the connection to be successful. The sub-protocol name
> must
> > be an ASCII string with no U+000A LINE FEED (LF) or U+000D CARRIAGE
> RETURN
> > (CR) characters in it.
>
> Fixed, thanks.
>
>
> > IIRC, in old spec draft, protocol should not be an empty string, but
> > current spec draft accepts it?
>
> Man, I'm just incompetent today. Sorry about that. Fixed.
>

Thanks!

protocol now accepts U+0020. Is it ok to use U+0020 only in /protocol/ ?
(e.g. new WebSocket("ws://example.com/", " "); )
It seems space is optional after colon in field of handshake message, how
can we distinguish U+0020 and U+0020 U+0020 ?


>
>
> > > > And, why is it limited to ASCII instead of UTF-8?
> > >
> > > Because the HTTP working group refuse to allow UTF-8 in HTTP headers
> > > for reasons that I don't really understand, and the handshake is
> > > supposed to be valid HTTP.
> >
> > Hmm, then it should be mentioned in The Web Socket protocol 1.2 Protocol
> > overview? It looks websocket message accept UTF-8 in handshake message.
>
> There should be no way to _send_ UTF-8 in the handshake at this point,
> given the requirements in the spec, but once you _receive_ the handshake,
> it's no longer HTTP, it's just WebSocket, so you can use UTF-8 fine. (In
> practice it doesn't mean much, since there's nothing in the
> server-to-client handshake other than the client-to-server handshake, so
> if there ever was UTF-8 in the server-to-client handshake, it would either
> be ignored, or the connection would be dropped, depending on where exactly
> the UTF-8 was found.)
>

Ok. I see.


>
> HTH,
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091208/35c30b0b/attachment-0002.htm>


More information about the whatwg mailing list