Return-Path: Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@www.apache.org Received: (qmail 7403 invoked from network); 22 Oct 2004 15:50:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Oct 2004 15:50:28 -0000 Received: (qmail 98480 invoked by uid 500); 22 Oct 2004 15:50:27 -0000 Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@jakarta.apache.org Received: (qmail 98299 invoked by uid 500); 22 Oct 2004 15:50:25 -0000 Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Commons HttpClient Project" Reply-To: "Commons HttpClient Project" Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 98284 invoked by uid 99); 22 Oct 2004 15:50:25 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of bruce.mchaffie@entrust.com designates 216.191.252.11 as permitted sender) Received: from [216.191.252.11] (HELO sottmxssm1.entrust.com) (216.191.252.11) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 22 Oct 2004 08:50:25 -0700 Received: from SOTTMXS01.entrust.com ([10.4.61.7]) by sottmxssm1.entrust.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i9MGSCqV005145 for ; Fri, 22 Oct 2004 12:28:13 -0400 Received: by sottmxs01.entrust.com with Internet Mail Service (5.5.2657.72) id <4WZS3SD4>; Fri, 22 Oct 2004 11:50:18 -0400 Message-ID: <7A3E1242FA9989439AD1F9B2D71C287F017CDAA1@sottmxs05.entrust.com> From: Bruce McHaffie To: "'Commons HttpClient Project'" Subject: RE: Auto-detecting proxy settings in a standalone Java app Date: Fri, 22 Oct 2004 11:47:50 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Chris, I just meant decompile the plugin.jar code and take a look at what Sun does for getting proxy settings. I've never tried loading plugin.jar outside a browser. That's an interesting idea though. Bruce. -----Original Message----- From: Chris Brown [mailto:chris92250@hotmail.com] Sent: October 22, 2004 10:35 AM To: commons-httpclient-dev@jakarta.apache.org Subject: RE: Auto-detecting proxy settings in a standalone Java app Hi, I can get this to work within an applet, but not standalone. When running standalone, I have the "plugin.jar" file in the classpath (it was also obviously in the classpath at compile time)... However, when standalone, it fails to load a dependent DLL.. Here's the code: package sandbox; import sun.plugin.net.proxy.*; public class Test { public static void main(String[] args) { WIExplorerProxyConfig wiExplorerProxyConfig = new WIExplorerProxyConfig(); BrowserProxyInfo browserProxyInfo = wiExplorerProxyConfig.getBrowserProxyInfo(); System.out.println(browserProxyInfo.getHttpHost()); } } And here's the stack trace: java.lang.UnsatisfiedLinkError: initIDs at sun.plugin.services.WinRegistry.initIDs(Native Method) at sun.plugin.services.WinRegistry.init(WinRegistry.java:113) at sun.plugin.net.proxy.WIExplorerProxyConfig.getBrowserProxyInfo(WIExplorerPro xyConfig.java:45) at sandbox.Test.main(Test.java:18) And (going over the top), here's the launch command: C:\java\jdk1.4.2\bin\java -Didea.launcher.port=7533 -Didea.launcher.library=C:\java\idea\bin\breakgen.dll -Dfile.encoding=windows-1252 -classpath "C:\java\jdk1.4.2\jre\lib\charsets.jar;C:\java\jdk1.4.2\jre\lib\jce.jar;C:\j ava\jdk1.4.2\jre\lib\jsse.jar;C:\java\jdk1.4.2\jre\lib\plugin.jar;C:\java\jd k1.4.2\jre\lib\rt.jar;C:\java\jdk1.4.2\jre\lib\sunrsasign.jar;C:\java\jdk1.4 .2\jre\lib\ext\dnsns.jar;C:\java\jdk1.4.2\jre\lib\ext\ldapsec.jar;C:\java\jd k1.4.2\jre\lib\ext\localedata.jar;C:\java\jdk1.4.2\jre\lib\ext\sunjce_provid er.jar;C:\Documents and Settings\christopher.brown\IdeaProjects\SIS-Demat-Applets\classes;C:\java\pr ojects\demat-applet\java\lib\assembla_msks_jce.jar;C:\java\projects\demat-ap plet\java\lib\commons-codec-1.3.jar;C:\java\projects\demat-applet\java\lib\c ommons-httpclient-3.0-alpha2.jar;C:\java\projects\demat-applet\java\lib\comm ons-logging.jar;C:\java\idea\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain sandbox.Test Any thoughts? Thanks, Chris I obviously need some other file in the path, but I don't know which... >From: Bruce McHaffie >Reply-To: "Commons HttpClient Project" > >To: "'Commons HttpClient Project'" > >Subject: RE: Auto-detecting proxy settings in a standalone Java app >Date: Fri, 22 Oct 2004 09:41:57 -0400 > >Hi Chris, > >You may also want to take a look at the plugin.jar that ships with the >JRE. You'll find some good stuff in >sun.plugin.net.proxy.WIExplorerProxyConfig. >Here are the registry entries that Sun looks for in that class. > > private static final String REGSTR_PATH_INTERNET_SETTINGS = >"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; > private static final String REGSTR_VAL_PROXYENABLE = "ProxyEnable"; > private static final String REGSTR_VAL_PROXYSERVER = "ProxyServer"; > private static final String REGSTR_VAL_PROXYOVERRIDE = >"ProxyOverride"; > private static final String REGSTR_VAL_AUTOCONFIGURL = >"AutoConfigURL"; > > >There are also proxy detection classes for other browsers in the same >package. > >Bruce. > > > >-----Original Message----- >From: Roland Weber [mailto:ROLWEBER@de.ibm.com] >Sent: October 22, 2004 7:16 AM >To: Commons HttpClient Project >Subject: Re: Auto-detecting proxy settings in a standalone Java app > > >Hello Chris, > >setting a fantasy proxy server in IE and searching for it in the >registry >yields: > >HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet >Settings >-> ProxyServer >-> ProxyEnable > > >a quick search on Google for "Java Windows Registry" yields: > >http://www.trustice.com/java/jnireg/ >A public domain solution to access the Windows registry. > >http://sourceforge.net/projects/jregistrykey/ >An LGPL-licensed solution to access the Windows registry. > > >hope that helps, > Roland > > > > > >"Chris Brown" >22.10.2004 12:45 >Please respond to >"Commons HttpClient Project" > > >To >commons-httpclient-dev@jakarta.apache.org >cc > >Subject >Re: Auto-detecting proxy settings in a standalone Java app > > > > > > >Hi, > >Thanks for all the rapid feedback so far. > >I don't have VB or the VB runtime, although perhaps I could use the >JNIWrapper software to access this information (if I knew where it >was...!). > Pity the Webstart proxy detection stuff isn't available for all to >see, as it returns (I think) appropriate params, whether you use IE or >Mozilla or whatever. > >On the other hand, given that JNIWrapper is commercial software, >perhaps someone would know how to write a simple C program with "mingw" >or whatever (easy to compile). It could detect params and return them >on STDOUT, to be >picked up either by a startup.bat or even through Runtime.exec() (solving >the "restart the JVM" problem discussed earlier in this thread). > >First thing's first though... does anyone know where this information >is stored in Windows ? IE and Mozilla/Firefox seem good targets for >starters. > >Hey, why not even a little optional subproject for HTTPClient >(requiring JNI and a compiler, preferably not *requiring* the MS tool >chain), with a simple >ProxyDetector interface, and a series of platform-specific implementations > >(to go further than my current Windows-only need) ? > >Any thoughts on these big ideas, or at least as far as solving the >immediate problem (where are these settings stored and how can I get at >them?) > >Thanks to all, >Chris > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: >commons-httpclient-dev-unsubscribe@jakarta.apache.org >For additional commands, e-mail: >commons-httpclient-dev-help@jakarta.apache.org > _________________________________________________________________ Hotmail : bient�t 250 Mo de stockage ! http://www.imagine-msn.com/hotmail/fr-fr/ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org