Subject: Re: [quicwg/base-drafts] Describe CONNECT method (#100)

From: Martin Thomson <[email-masked]>
Date: Mon, 02 Jan 2017 22:30:13 -0800

martinthomson commented on this pull request.

> @@ -246,6 +246,44 @@ DISCUSS:
 do we need to retain compatibility with HTTP/2's HPACK? 

+### The CONNECT Method
+
+In HTTP/1.x, the pseudo-method CONNECT ({{!RFC7231}}, Section 4.3.6) is used to 
+convert an HTTP connection into a tunnel to a remote host. CONNECT is primarily 
+used with HTTP proxies to establish a TLS session with an origin server for the 
+purposes of interacting with "https" resources. In HTTP/2, the CONNECT method is 
+used to establish a tunnel over a single HTTP/2 stream to a remote host for 
+similar purposes. 

This probably needs to use QUIC rather than HTTP/2.

> +purposes of interacting with "https" resources. In HTTP/2, the CONNECT method is 
+used to establish a tunnel over a single HTTP/2 stream to a remote host for 
+similar purposes. 
+
+A CONNECT request in HTTP/QUIC functions in the same manner as in HTTP/2. The 
+request MUST be formatted as described in {{!RFC7540}}, Section 8.3. A CONNECT 
+request that does not conform to these restrictions is malformed. The message 
+data stream MUST NOT be closed at the end of the request. 
+
+A proxy that supports CONNECT establishes a TCP connection ({{!RFC0793}}) to the 
+server identified in the ":authority" pseudo-header field. Once this connection 
+is successfully established, the proxy sends a HEADERS frame containing a 2xx 
+series status code to the client, as defined in {{!RFC7231}}, Section 4.3.6, on 
+the message control stream. 
+
+All activity on the message data stream corresponds to data sent on the TCP 

s/activity/STREAM frames sent/

> +used to establish a tunnel over a single HTTP/2 stream to a remote host for 
+similar purposes. 
+
+A CONNECT request in HTTP/QUIC functions in the same manner as in HTTP/2. The 
+request MUST be formatted as described in {{!RFC7540}}, Section 8.3. A CONNECT 
+request that does not conform to these restrictions is malformed. The message 
+data stream MUST NOT be closed at the end of the request. 
+
+A proxy that supports CONNECT establishes a TCP connection ({{!RFC0793}}) to the 
+server identified in the ":authority" pseudo-header field. Once this connection 
+is successfully established, the proxy sends a HEADERS frame containing a 2xx 
+series status code to the client, as defined in {{!RFC7231}}, Section 4.3.6, on 
+the message control stream. 
+
+All activity on the message data stream corresponds to data sent on the TCP 
+connection. Any data sent by the client is transmitted by the proxy to the TCP 

Any STREAM frame

> +A proxy that supports CONNECT establishes a TCP connection ({{!RFC0793}}) to the 
+server identified in the ":authority" pseudo-header field. Once this connection 
+is successfully established, the proxy sends a HEADERS frame containing a 2xx 
+series status code to the client, as defined in {{!RFC7231}}, Section 4.3.6, on 
+the message control stream. 
+
+All activity on the message data stream corresponds to data sent on the TCP 
+connection. Any data sent by the client is transmitted by the proxy to the TCP 
+server; data received from the TCP server is written to the data stream by the 
+proxy. 
+
+The TCP connection can be closed by either peer. When the client half-closes the 
+data stream, the proxy will set the FIN bit on its connection to the TCP server. 
+When the proxy receives a packet with the FIN bit set, it will half-close the 
+corresponding data stream. Note that the size and number of TCP segments is not 
+guaranteed to map predictably to the size and number of QUIC STREAM frames. 

Move this last sentence to the previous paragraph.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/100#pullrequestreview-14888559

---

From: Mike Bishop <[email-masked]>
Date: Tue, 03 Jan 2017 13:42:59 -0800

MikeBishop commented on this pull request.

+### The CONNECT Method
+

This was intentional:  "HTTP/1.1 does this; HTTP/2 does this. <para>  Here's how it works in HTTP/QUIC:"  If that's not clear, any suggestions on how to improve it?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/100

---

From: Mike Bishop <[email-masked]>
Date: Tue, 03 Jan 2017 13:48:35 -0800

@MikeBishop pushed 1 commit.

cd6c622  Martin's feedback on CONNECT

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/100/files/43830f31ce7e0f8676243eb32bdd99b3fa93d718..cd6c6222fe52406feb47625b4cd8518061489458

---

From: Martin Thomson <[email-masked]>
Date: Tue, 10 Jan 2017 14:07:27 -0800

martinthomson approved this pull request.

+### The CONNECT Method
+

I would move the second sentence to be the first, this establishes the purpose.  Then you can say how: In HTTP/1.x, CONNECT is used to convert an entire connection into a tunnel to a remote host; in HTTP/2 a single stream is converted into a tunnel.

Then the rest flows naturally.

+server identified in the ":authority" pseudo-header field. Once this connection 
+is successfully established, the proxy sends a HEADERS frame containing a 2xx 
+series status code to the client, as defined in {{!RFC7231}}, Section 4.3.6, on 
+the message control stream. 
+
+All QUIC STREAM frames on the message data stream correspond to data sent on the 
+TCP connection. Any QUIC STREAM frame sent by the client is transmitted by the 
+proxy to the TCP server; data received from the TCP server is written to the 
+data stream by the proxy. Note that the size and number of TCP segments is not 
+guaranteed to map predictably to the size and number of QUIC STREAM frames. 
+
+The TCP connection can be closed by either peer. When the client half-closes the 
+data stream, the proxy will set the FIN bit on its connection to the TCP server. 
+When the proxy receives a packet with the FIN bit set, it will half-close the 
+corresponding data stream.

I realize now that there is a hole in the definition in h2: when the TCP server sends a packet with the FIN bit, the proxy needs to forward this to the client.  This isn't a RST_STREAM it's a stream half-close.  The expectation is that the client also respond to the half-close, but we don't say that the client MUST close.  I think we should.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/100#pullrequestreview-16023694

---

From: Mike Bishop <[email-masked]>
Date: Tue, 10 Jan 2017 14:30:08 -0800

Half-closed TCP connections with ongoing data are valid, albeit rare.  I'm ambivalent about excluding them from the use of CONNECT.

---

From: Patrick McManus <[email-masked]>
Date: Tue, 10 Jan 2017 14:32:24 -0800

mcmanus commented on this pull request.

i think @MikeBishop is right.. should probably also call this out for the reader's attention

---

From: Mike Bishop <[email-masked]>
Date: Thu, 12 Jan 2017 12:02:02 -0800

e20c7cd  Addressing feedback

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/100/files/cd6c6222fe52406feb47625b4cd8518061489458..e20c7cdb0fc5da5afb2a198135850a661b03b1ad

---

From: Mike Bishop <[email-masked]>
Date: Thu, 12 Jan 2017 12:05:35 -0800

@MikeBishop pushed 2 commits.

59cf444  Merge remote-tracking branch 'origin/master' into connect
e9081f3  Hook up the error code

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/100/files/e20c7cdb0fc5da5afb2a198135850a661b03b1ad..e9081f3f229f2ce240ddf9cd8f9ec89585f07148

---

From: Mike Bishop <[email-masked]>
Date: Thu, 12 Jan 2017 12:06:46 -0800

Merged #100.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/100#event-921302324