This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 210679

Summary: Provide API to get configured non-proxy hosts
Product: platform Reporter: Petr Hejl <phejl>
Component: ProxyAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Petr Hejl 2012-04-04 09:17:27 UTC
External processes started from NB may need this information to be available via API.
Comment 1 phansson 2014-09-06 20:25:40 UTC
Can't be done. There's no such thing as a fixed list. At least not on most sites these days.

True that back in the old days this would be configured as a fixed list somewhere in the OS. However, today, many sites are using PAC (proxy auto-configuration) which means that a .pac file needs to be evaluated everytime Java needs to reach a network destination. The .pac file (which is really a JavaScript script) may return different result depending on things like time of day or even depending on who's asking.

The list you are after is essentially all the inputs for which this script would return "DIRECT". Problem is that such list varies with the result of the .pac file evaluation.

The NetBeans ProxySelector is available throughout the JVM session, no matter if that session is the IDE itself or a NetBeans Platform application. You can ask it questions such as "which proxy to use for this endpoint?". However all standard Java networking calls, such as URLConnection, actually asks the ProxySelector on your behalf and thereby makes a choice on how to reach the endpoint (use a proxy or not, if use a proxy then which one?, etc). It all happens behind the scenes in Java, not NetBeans.