Created attachment 446214 [details] WebSocket connection timeout errors in the JavaScript Console. – Overview: On macOS Monterey systems with configured Automatic Proxy Configuration (.pac) file or HTTP/HTTPS proxy servers, Safari doesn't use the proxy when establishing WebSocket connections if the experimental feature "NSURLSession WebSocket" is enabled (that is the default setting on Monterey). – Steps to Reproduce: 1) Set a PAC file or HTTP/HTTPS proxy in System Preferences --> Network. 2) Go to https://ws.ifelse.io/.ws (that server is running https://github.com/jmalloc/echo-server according to this Stack Overflow question https://stackoverflow.com/questions/4092591/websocket-live-server). – Actual Results: On networks where Internet access is allowed only using the network proxy, the connection will not succeed and JavaScript Console will yield: WebSocket connection to 'wss://ws.ifelse.io/' failed: The request timed out. – Expected Results: Safari should use the system proxy. – Build Date & Hardware: I've tested this issue on macOS Monterey 12.0.1 (21A559) with the following Safari builds: • Safari 15.1 (17612.2.9.1.20) <-- current version on Monterey • Safari Technology Preview release 135 (Safari 15.4, WebKit 17613.1.7.3) • WebKit build archive r286598 <-- it actually threw a bunch of errors on startup and I was unable to test by disabling "NSURLSession WebSocket" because when I tried to open its Preferences to enable the Development menu, it crashed… so I'm not 100% sure about this test – Additional Information: If I disable the "NSURLSession WebSocket" experimental feature, system proxy is used and connections succeed.
Thank you for the report. We are tracking this internally as rdar://84740185
Marking as MOVED per the above, as the fix will be below WebKit.