Re: [whatwg/fetch] Add proxy support to obtain a connection (#1259)

@ricea commented on this pull request.

I'm not sure what if anything we need to write to handle complex cases like when `FindProxyForURL()` returns something like `"PROXY proxy:3128; PROXY proxy2:8080; DIRECT"`. In this case 

1. Try `proxy:3128` for "example.com"
2. If connection failed, try `proxy2:8080` for "example.com"
3. If connection failed, do a host lookup on "example.com"
4. Attempt connection to one or more of the IPs returned by the host lookup.

> @@ -2349,38 +2348,59 @@ steps:
    <a>connection</a>.
   </ol>
 
+ <li>
+  <p>Let <var>proxies</var> be the result of performing proxy resolution for <var>url</var> in an
+  <a>implementation-defined</a> manner. If a proxy preference order has not been explicitly
+  configured, then SOCKS proxies should be preferred to HTTPS proxies which should be preferred to

This part is WebSocket-specific.

For HTTP and HTTPS we prefer to match the proxy type.

The reasoning is that the proxy configured for "HTTPS" may be optimised for the "CONNECT" method (ie. low latency, no cache) and the proxy configured for "HTTP" may be optimised oppositely. Which protocol they use is orthogonal to what protocol they are configured for. In fact, it might be perfectly reasonable to use `https://proxy.local/` for the HTTP proxy and `http://proxy.local:3128/` for the HTTPS proxy.

SOCKS works like a fallback in the non-WebSocket case, and will only be used if a matching proxy type is not there.

This only applies to static configurations. If proxy configuration happens via a JavaScript file (`proxy.pac` or `wpad.dat`), it decides the priority.

The way that manual proxy configuration works varies by OS, and we probably shouldn't say anything about the priority order except in the WebSocket case where the underlying RFC6455 attempts to dictate 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/whatwg/fetch/pull/1259#pullrequestreview-692302890

Received on Thursday, 24 June 2021 23:19:37 UTC