Re: [hybi] #4: handshake does not work properly with HTTP reverse proxy.

Willy Tarreau <w@1wt.eu> Thu, 02 September 2010 06:11 UTC

Return-Path: <w@1wt.eu>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 285D83A6A63 for <hybi@core3.amsl.com>; Wed, 1 Sep 2010 23:11:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.4
X-Spam-Level:
X-Spam-Status: No, score=-2.4 tagged_above=-999 required=5 tests=[AWL=-0.957, BAYES_00=-2.599, HELO_IS_SMALL6=0.556, J_CHICKENPOX_72=0.6]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F0u7jz2LjXlI for <hybi@core3.amsl.com>; Wed, 1 Sep 2010 23:11:22 -0700 (PDT)
Received: from 1wt.eu (1wt.eu [62.212.114.60]) by core3.amsl.com (Postfix) with ESMTP id EE7603A6A4F for <hybi@ietf.org>; Wed, 1 Sep 2010 23:11:21 -0700 (PDT)
Received: (from willy@localhost) by mail.home.local (8.14.4/8.14.4/Submit) id o826BYqX012225; Thu, 2 Sep 2010 08:11:34 +0200
Date: Thu, 02 Sep 2010 08:11:34 +0200
From: Willy Tarreau <w@1wt.eu>
To: hybi issue tracker <trac@tools.ietf.org>
Message-ID: <20100902061134.GJ10275@1wt.eu>
References: <068.da8db0c773647cb0ed73d576f39e93ee@tools.ietf.org> <077.16770a1037c185a3fde75a9b560a236a@tools.ietf.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <077.16770a1037c185a3fde75a9b560a236a@tools.ietf.org>
User-Agent: Mutt/1.4.2.3i
Cc: hybi@ietf.org, sm+ietf@elandsys.com
Subject: Re: [hybi] #4: handshake does not work properly with HTTP reverse proxy.
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Sep 2010 06:11:26 -0000

On Mon, Aug 30, 2010 at 10:24:09PM -0000, hybi issue tracker wrote:
> #4: handshake does not work properly with HTTP reverse proxy.
> -------------------------------------------+--------------------------------
>  Reporter:  salvatore.loreto@???             |       Owner:     
>      Type:  defect                         |      Status:  new
>  Priority:  critical                       |   Milestone:     
> Component:  thewebsocketprotocol           |     Version:     
>  Severity:  Active WG Document             |    Keywords:     
> -------------------------------------------+--------------------------------
> 
> Comment(by ifette@???):
> 
>  I definitely want to figure out how to fix this issue. That said, even
>  reading the linked messages, I don't see any solutions readily available.
>  Putting the 8 bytes in a header seems to imply that we're not actually
>  certain that the proxy is capable of forwarding the data correctly (the
>  data that would be sent on the first message). This seems undesirable.
>  Adding a 2nd RTT is also desirable.
> 
>  From the referenced message http://www.ietf.org/mail-
>  archive/web/hybi/current/msg03238.html
> 
>  "Note that this data is used for three things :
>    - detection of cross-protocol communication
>    - ensure that no cache will return a cached content
>    - ensure that intermediaries correctly forward data after the 101
> 
>  "The first point and second points are not changed with a header. The
>  third point changes slightly. With the key in the data, it was able
>  to detect some of the proxies which would reset the connection during
>  the handshake. With the key3 in a header, it will only detect the
>  connection reset when trying to send data for the first time. However,
>  neither method detects intermediaries which don't forward request body
>  and remain stuck on it, so on this point there is no change."
> 
>  The status quo is also undesirable as we may hang on some proxies, which
>  also is a bad state to be in.
> 
>  My understanding of this issue is that we are still looking for a
>  solution. As such, I am not planning to address this in -01, but will make
>  a note of the issue and that it is still open.

It is possible to keep the same exchange but only state that the server must
respond the 101 as soon as it has got all the headers, then read the nonce
and respond with the hash. It's left as a choice on the client side to decide
whether it wants to send them both at once to avoid a round-trip, or one at
a time in case some authentication or anything else is required.

However I think that we should discuss this on the list once the new framing
is agreed upon : instead of having both the client and the server implement
a specific case for something barely looking like some data can flow, we can
as well send a real WS frame and expect a real one in return (eg: ping+pong).
It would then be the real opening handshake which might be used later when
the protocol evolves to other non-HTTP transport methods. HTTP would then be
just for connection establishment up to, but not including the WS handshake.

Regards,
Willy