Repository navigation
Conversation
0d3294a to
b9dcfd9
Compare
|
Gift for @gquintard Marked as draft bc I still have some tests to add |
148382c to
d0a9ecd
Compare
d0a9ecd to
bd9ef1c
Compare
|
Would it make sense to explicitly set SETTINGS_ENABLE_CONNECT_PROTOCOL (0x8) = 0 for h2 to make sure that clients wont even try to use connect over h2? |
bd9ef1c to
54b7eb7
Compare
|
First: Why?! What is the use-case for CONNECT in a server-side proxy as opposed to a client-side proxy ? Second: This SHALL be disabled by default so a Varnish instance is not an open relay by default. |
|
@cartoush did you look at what it would take to make this possible with |
|
@phk: I can answer the first question: "server-side" get a bit murky when Varnish is used internally and it's "just" an HTTP gateway. But semantics aside, we have users who want to use Varnish as a forward proxy and are currently using a patched Varnish to meet that need. No problem with deactivating this by default I believe. @nigoroll: |
|
@gquintard It's clear that
IIUC the patch herein uses the fixed static response, but I would think this might not fit all cases? This patch also generates the response from So what would we need?
On the latter, there is good groundwork in VIP30 , which is being discussed in #3471 IMHO, work should continue there. If anyone wants |
|
My bad, I misunderstood your question, in the sense we did look at a bunch of different ways on how to handle it, and this looked like the cleanest one without requiring massive amounts of foundational work. Essentially, we saw 4 different approaches:
At the moment, I don't see a way to achieve this feature without core modifications |
And check that there are no other bits raised in cnt_pipe().
In CONNECT mode, transfer will be opaque like in PIPE mode. There will however be no bereq to send. However, a busyobj will be needed to resolve the backend, so a minimal one is created that does not log anything. It will consume a VXID and not use it, but we have plenty of those. Better diff with the --ignore-all-space option.
In CONNECT mode there will be no VCL execution, so we can already emit the Process timestamp.
The main difference between pipe and CONNECT is that only pipe sends a bereq and needs to create a task for the busyobj. On the other hand we will send a resp in CONNECT mode. Since CONNECT mode establishes a tunnel, this must force a fresh connection. This cannot be used like pipe mode with HTTP upgrades. CONNECT transactions get their dedicated set of timestamps.
The setup is minimal compared to pipe mode, because we don't need a full fledge busyobj.
We cannot register the number of response header bytes because we don't have this information from the transport::minimal_response() method.
Like pipe transactions, the total number of bytes received from the client does not include header bytes from the CONNECT request.
6ba4f94 to
d735623
Compare
Varnish MUST not send Content-Length nor Transfer-Encoding headers in succesful responses to CONNECT requests, including synthetic ones https://www.rfc-editor.org/rfc/rfc9110#section-9.3.6-12
d735623 to
3ffcfca
Compare
|
@gquintard I see nothing wrong with a vmod pulling in a lot of core code, at least not for a "time to market" implementation.
It's interesting that you bring up this point against a generic I really think we should focus work on the long term solution |
|
being dependent from internal code wasn't so much the issue as having to duplicate a lot of code into the vmod, but yes, I see your point. I'm actually very favorable to the |
This is my opinion, yes. Regarding the other point:
Yes, we have too many plans open for too long, but that should not mislead us to suddenly started reaching for short-sighted solutions. This project has a long track record of resisting the easy way and I can tell you that I was frustrated about it soo often, and man, frustrated I was. But it was and is the right way to do things properly. So regarding our backlog of ideas, I really think we need to follow those which we agreed upon, and work incrementally in the right direction. We do this in a lot of other places (#4035 is an example which comes to mind immediately, but I am sure there are others) and I think it works. It needs patience, but it works. |
This PR aims at adding support for CONNECT requests