Re: [hybi] New Version Notification for draft-mcmanus-httpbis-h2-websockets-00.txt

Andy Green <> Mon, 16 October 2017 04:44 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 15FC1134211 for <>; Sun, 15 Oct 2017 21:44:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id N3Xi4mpkFszX for <>; Sun, 15 Oct 2017 21:44:26 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id C475F13420F for <>; Sun, 15 Oct 2017 21:44:26 -0700 (PDT)
To: Martin Thomson <>
Cc: Patrick McManus <>, hybi <>, Cory Benfield <>, Patrick McManus <>, HTTP Working Group <>
References: <> <> <> <> <> <> <> <> <> <> <> <> <>
From: Andy Green <>
Message-ID: <>
Date: Mon, 16 Oct 2017 12:44:07 +0800
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
In-Reply-To: <>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [hybi] New Version Notification for draft-mcmanus-httpbis-h2-websockets-00.txt
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Server-Initiated HTTP <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 16 Oct 2017 04:44:28 -0000

On 10/16/2017 12:15 PM, Martin Thomson wrote:
> On Mon, Oct 16, 2017 at 3:06 PM, Andy Green <> wrote:
>> What you are saying will save time I already assume is "for free" since it
>> happens during the time the HTML is fetched.
> Assuming that you need to some HTML, that will take a round trip, but
> that is concurrent with learning that the server supports websockets.
> After that, you should be able to CONNECT and send any frames at the
> same time:
> C: GET /index.html
> S: SETTINGS  <-- I support :protocol
> S: 200 + DATA
> C: CONNECT + ws hs + DATA <-- client's first WS frames

Well, you can't pipeline all those.  The way ws works the client 
proposes one or more protocols and extensions.  The server looks at what 
was sent and picks one protocol and zero or more extensions...

> S: 200 + ws hs + DATA <-- server's first WS frames

...only after receiving the server's decision in the final ws hs 
headers, can the client send any ws data, because until then he doesn't 
know the disposition of the ws subprotocol or extensions for the stream.

You can probably pipeline the CONNECT + ws handshake though, Patrick 
shows them sequentially and I didn't think about it myself.

> Still only two round trips.

  - SETTINGS                      - SETTINGS
  - GET /index.html
                  - 200 HEADERS + DATA

  - :method CONNECT
  - DATA ws handshake
                   - 200 HEADERS
                   - DATA ws handshake final
		  - DATA...

  - DATA ...             - DATA...

With the part of the pipelining that is legal for ws, two round trips 
before the client can start to send data and 1.5 before the server can 
send data... if it's true then you're right it's not so bad.

> Were you concerned that the client needs to learn that the server
> supports websockets and not just :protocol?

No I just followed Patrick's sequencing; he shows them serialized.  But 
you're right at least the CONNECT + ws handshake can probably be pipelined.

That's also going to be a variation from normal h2 HEADERS flow if I 
understood it, on one stream there will be END_HEADERs coming twice (for 
the CONNECT and the ws handshake separately)

Anyway you are right, it makes any difference with PUSH_PROMISE probably 
not worth the effort.