Index: core/launcher/unix/nbexec =================================================================== RCS file: /cvs/core/launcher/unix/nbexec,v retrieving revision 1.23 diff -u -r1.23 nbexec --- core/launcher/unix/nbexec 11 Apr 2005 14:09:25 -0000 1.23 +++ core/launcher/unix/nbexec 19 Apr 2005 07:51:01 -0000 @@ -242,10 +242,15 @@ if [ -x $gconftool -a "`$gconftool --get /system/proxy/mode 2>/dev/null`" = manual ] ; then http_proxy_host=`$gconftool --get /system/http_proxy/host 2>/dev/null` http_proxy_port=`$gconftool --get /system/http_proxy/port 2>/dev/null` + http_proxy_ignore_hosts=`$gconftool --get /system/http_proxy/ignore_hosts 2>/dev/null` fi if [ ! -z "$http_proxy_host" -a ! -z "$http_proxy_port" ] ; then jargs="$jargs -Dnetbeans.system_http_proxy=$http_proxy_host:$http_proxy_port" +fi + +if [ ! -z "$http_proxy_ignore_hosts" ] ; then + jargs="$jargs -Dnetbeans.system_http_proxy_ignore_hosts=$http_proxy_ignore_hosts" fi Index: core/src/org/netbeans/core/IDESettings.java =================================================================== RCS file: /cvs/core/src/org/netbeans/core/IDESettings.java,v retrieving revision 1.65 diff -u -r1.65 IDESettings.java --- core/src/org/netbeans/core/IDESettings.java 3 Mar 2005 17:13:06 -0000 1.65 +++ core/src/org/netbeans/core/IDESettings.java 19 Apr 2005 07:51:01 -0000 @@ -129,6 +129,7 @@ super.initialize (); System.setProperty (KEY_PROXY_HOST, getProxyHost ()); System.setProperty (KEY_PROXY_PORT, getProxyPort ()); + System.setProperty (KEY_NON_PROXY_HOSTS, getDefaultNonProxyHosts()); putProperty(PROP_WWWBROWSER, "", false); } @@ -272,6 +273,7 @@ } System.setProperty (KEY_PROXY_HOST, getProxyHost ()); System.setProperty (KEY_PROXY_PORT, getProxyPort ()); + System.setProperty (KEY_NON_PROXY_HOSTS, getDefaultNonProxyHosts()); } } @@ -530,11 +532,32 @@ * @return sensible default for non-proxy hosts, including 'localhost' */ private String getDefaultNonProxyHosts() { - String nonProxy = "localhost"; // NOI18N + String systemIgnoreHosts = System.getProperty ("netbeans.system_http_proxy_ignore_hosts"); // NOI18N + if (systemIgnoreHosts != null) { + return systemIgnoreHosts; + } + + String nonProxy = "localhost|127.0.0.1"; // NOI18N + String localhost = ""; // NOI18N try { - String localhost = InetAddress.getLocalHost().getHostName(); + localhost = InetAddress.getLocalHost().getHostName(); if (!localhost.equals("localhost")) { // NOI18N nonProxy = nonProxy + "|" + localhost; // NOI18N + } else { + // Avoid this error when hostname == localhost: + // Error in http.nonProxyHosts system property: sun.misc.REException: localhost is a duplicate + } + } + catch (UnknownHostException e) { + // OK. Sometimes a hostname is assigned by DNS, but a computer + // is later pulled off the network. It may then produce a bogus + // name for itself which can't actually be resolved. Normally + // "localhost" is aliased to 127.0.0.1 anyway. + } + try { + String localhost2 = InetAddress.getLocalHost().getCanonicalHostName(); + if (!localhost2.equals("localhost") && !localhost2.equals(localhost)) { // NOI18N + nonProxy = nonProxy + "|" + localhost2; // NOI18N } else { // Avoid this error when hostname == localhost: // Error in http.nonProxyHosts system property: sun.misc.REException: localhost is a duplicate