W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2016

Re: 6455 Websockets and the relationship to HTTP

From: Loïc Hoguin <essen@ninenines.eu>
Date: Fri, 23 Dec 2016 16:28:24 +0100
To: Mark Nottingham <mnot@mnot.net>, Wenbo Zhu <wenboz@google.com>
Cc: Patrick McManus <mcmanus@ducksong.com>, Takeshi Yoshino <tyoshino@google.com>, Martin J. Dürst <duerst@it.aoyama.ac.jp>, Andy Green <andy@warmcat.com>, Amos Jeffries <squid3@treenet.co.nz>, HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <ad1fef78-f2eb-2066-5b2b-8226254c4a29@ninenines.eu>
On 12/23/2016 03:40 PM, Mark Nottingham wrote:
> Sorry to perpetuate this thread, but...
> On 15 Dec. 2016, at 11:39 am, Wenbo Zhu <wenboz@google.com> wrote:
>> On non-browsers,
> *confused*
> AIUI the *only* reasonable use case for WebSockets is browsers; who is using it without a browser?
> (keeping in mind that WS is effectively TCP constrained by the Web security / same-origin model)

The three bigger Websocket users I have seen are:

* browsers;
* phone applications;
* servers

Excluding Websocket sub protocols, generally the pattern is the same: a 
server has an HTTP API and some of that API is implemented using 
Websocket to allow the server to push data to the client.

This usage can arguably be replaced by HTTP/2 with push. It is closer in 
spirit to text/event-stream, while also allowing binary data without 
using base64 on that data beforehand. It's not TCP but rather a more 
generalized event push mechanism than text/event-stream provides.

Most of the cases I have seen the usage is much lighter than HTTP/2 push 
provides; there's no cache involved, and the intent is to send the event 
to the client as soon as possible (ie without having to go through the 
push promise and response headers first).

A Websocket over HTTP/2 would allow those users to use the HTTP and 
Websocket API over a single connection.

Servers that use Websocket to speak to each other simply use the same 
interface other clients do. For servers it's more about code reuse than 
any other considerations. Developer implements HTTP/Websocket server for 
phone apps; writes a client module for testing this server; uses the 
client module to speak to other servers.

The same-origin only seems useful for browsers in practice, I have not 
seen it applied elsewhere.

Loïc Hoguin
Received on Friday, 23 December 2016 15:29:29 UTC

This archive was generated by hypermail 2.3.1 : Friday, 23 December 2016 15:29:32 UTC