Fix: Use system default ProxySelector in HttpClient #2388 by combe4259 · Pull Request #2390 · jhy/jsoup (original) (raw)

@jhy

Description

Fixes #2388

Problem

HttpClient ignores system default proxy (ProxySelector.getDefault()).

Solution

select(): perRequestProxy → system ProxySelector → NoProxy

connectFailed() (One tiny opinion):
Only forwards to system ProxySelector when it was actually used
Returns early for perRequestProxy (prevents incorrect failure reporting)

Testing

Thanks to @robseidel for reporting and suggesting the fix.