g3 icon indicating copy to clipboard operation
g3 copied to clipboard

upgrade http version of incoming taffic http_proxy

Open GlenDC opened this issue 8 months ago • 5 comments

Hi, is there already support for upgrading the http version of incoming traffic into an http proxy server? If so, how can that be done, documentation doesn't seem to mention it. And it not, would you be open for a contribution, and if so, how would you have that in mind?

GlenDC avatar Mar 26 '25 21:03 GlenDC

The client send a http1 forward request and then g3proxy connnect to the upstream with a h2 connection? It's normal for a reverse proxy, but I don't think it's useful for a forward proxy. So what's the usecase here?

zh-jq avatar Mar 27 '25 01:03 zh-jq

It can be useful in case you have something in between proxy and client that can only do h1. This forces h1 on client, but the server forwarded though can only handle properly h2

GlenDC avatar Mar 27 '25 05:03 GlenDC

I think this can be done along with site level http upstream pool (not implemented yet). When a request arrive as a plain HTTP forward request (no TLS here), it will try to fetch a h1 connection or h2 stream from that pool, the pool itself will handle the creation of new h1/h2 connections.

The limitation here is that, you have to add site config in (anonymous) user config for each domain you want force h2.

zh-jq-b avatar Mar 27 '25 06:03 zh-jq-b

The design will be different for TLS traffic, as there won't any http pool used, just h1 <-> h2 conversion on connected connection in g3proxy/src/inspect/http. The ICAP client code also need to be added.

zh-jq-b avatar Mar 27 '25 06:03 zh-jq-b

I think this is a useful feature for roadmap.

mspublic avatar Apr 02 '25 20:04 mspublic