cloudflared-mirror/ingress
Nuno Diegues 0ab6867ae5 TUN-4947: Use http when talking to Unix sockets origins
Right now the proxying of cloudflared -> unix socket is a bit of
a no man's land, where we do not have the ability to specify the
actual protocol since the user just configures "unix:/path/"

In practice, we proxy using an HTTP client.
But it could be that the origin expects HTTP or HTTPS. However,
we have no way of knowing.

So how are we proxying to it? We are configuring the http.Request
in ways that depend on the transport and edge implementation, and
it so happens that for h2mux and http2 we are using a http.Request
whose Scheme is HTTP, whereas for quic we are generating a http.Request
whose scheme is HTTPS.

Since it does not make sense to have different behaviours depending
on the transport, we are making a (hopefully temporary) change so
that proxied requests to Unix sockets are systematically HTTP.

In practice we should do https://github.com/cloudflare/cloudflared/issues/502
to make this configurable.
2022-02-02 19:33:30 +00:00
..
ingress.go TUN-4655: ingress.StreamBasedProxy.EstablishConnection takes dest input 2021-07-07 15:58:04 +01:00
ingress_test.go TUN-4359: Warn about unused keys in 'tunnel ingress validate' 2021-05-13 02:05:19 +01:00
origin_connection.go Revert "TUN-5184: Make sure outstanding websocket write is finished, and no more writes after shutdown" 2021-10-25 19:51:52 +01:00
origin_connection_test.go TUN-5481: Create abstraction for Origin UDP Connection 2021-12-06 16:37:09 +00:00
origin_proxy.go TUN-4947: Use http when talking to Unix sockets origins 2022-02-02 19:33:30 +00:00
origin_proxy_test.go Add X-Forwarded-Host for http proxy 2021-11-16 02:20:36 +11:00
origin_request_config.go TUN-4359: Warn about unused keys in 'tunnel ingress validate' 2021-05-13 02:05:19 +01:00
origin_request_config_test.go TUN-4067: Reformat code for consistent import order, grouping, and fix formatting. Added goimports target to the Makefile to make this easier in the future. 2021-03-24 10:53:29 -05:00
origin_service.go TUN-4655: ingress.StreamBasedProxy.EstablishConnection takes dest input 2021-07-07 15:58:04 +01:00
origin_udp_proxy.go TUN-5481: Create abstraction for Origin UDP Connection 2021-12-06 16:37:09 +00:00
rule.go TUN-4655: ingress.StreamBasedProxy.EstablishConnection takes dest input 2021-07-07 15:58:04 +01:00
rule_test.go TUN-4655: ingress.StreamBasedProxy.EstablishConnection takes dest input 2021-07-07 15:58:04 +01:00