Accessing Proxy Settings

Hi,
I am trying to access user's proxy settings in my signed JApplet, but can't find any information about that in documentation. Can someone point me somewhere? I need them because I use Sockets in my program.
Thank you,
Dmitri

Detecting proxy settings that the plug-in is using is tricky stuff... Sun added some (not well documented) support for proxy detection... Try searching the jdc bug db for detect proxy, etc.
The extra jar that needs to be in your classpath during compile (if compiling under 1.3.1) is jre 1.4.1's rt.jar. BTW, we also include javaws.jar because our same JAppplet JARs run under Java Web Start.
I've clobbered together a method (that could use some cleaning:) that takes the URL of a file known to exist (anything from the applet's codebase, eg. settings.prop) & sets a couple booleans & proxy props... Seems to work pretty well except under Mac OS X:
static String proxyIP = "";
static int proxyPort = 80;
static boolean autoDetectProxy = false;  // If SSL version, assume autoDetect, else do not
static boolean useProxy = false;
detectProxy(<codebase file url>);
System.out.println ("Using Proxy:" + useProxy + " Auto Detect Proxy:" + autoDetectProxy + "Proxy IP:" + proxyIP + " Proxy Port:" + proxyPort);
void detectProxy(URL sampleURL) {
    // Added in 5.0.3 -  Plugin 1.4 will hide the internal Sun proxy stuff, so use new proxy property introduced in 1.3.0_1 (1.3.1)...
    // 5.0.7 Update: - Plugin 1.4 Final added com.sun.java.browser.net.* classes ProxyInfo & ProxyService... Use those with JREs => 1.4
    System.out.println(("About to attempt auto proxy detection under Java version:"+javaVers);
    boolean invokeFailover = false; // If specific, known detection methods fail may try fallback detection method
    if (javaVers.startsWith("1.3"))  {    //  Use Sun-specific internal plugin proxy classes for 1.3.X... 1.4.+ nuked this method...
        //  Look around for the 1.3.X plugin proxy detection class... Without it, cannot autodetect...
        try {
            Class t = Class.forName("sun.plugin.protocol.ProxyHandler");
            // Attempt to discover proxy info by asking internal plugin code to locate path to server sampleURL...
            sun.plugin.protocol.ProxyHandler proxyHandler = sun.plugin.protocol.PluginProxyHandler.getDefaultProxyHandler();
            if (proxyHandler != null) {
                try {
                    sun.plugin.protocol.ProxyInfo proxyInfo = proxyHandler.getProxyInfo (sampleURL);
                    if (proxyInfo != null) {
                        // Currently support HTTP non-authenticating proxies.  Authenticating proxies/SOCKS support TDB
                        /* Authenticating proxies need (actually, will need to use Header param of SSLTunneledSocket):
                            String authString = "userid:password";
                            String auth = "BASIC + new sun.misc.BASE64Encoder().encode(authString.getBytes());
                            URL theURL = ....
                            URLConnection urlConn = ....
                            urlConn.setRequestProperty("Proxy-Authorization", auth);
                        useProxy = (proxyInfo.getProxy() != null);
                        if (useProxy) {
                            proxyIP = proxyInfo.getProxy();
                            proxyPort = proxyInfo.getPort();
                            System.out.println("1.3.X proxy " + proxyIP+" port " + proxyPort);
                    else {
                        System.out.println("NULL proxyInfo in 1.3.X auto proxy detection, assuming no proxy...");
                        autoDetectProxy = false;
                catch (Exception e) {
                    System.out.println("Exception during 1.3.X auto proxy detection, will try failover detection, e:"+e);
                    invokeFailover = true;
        catch (Exception ee) {
            System.out.println("Sun Plugin 1.3.X proxy detection class not found, will try failover detection, e:"+ee);
            invokeFailover = true;
    else if (javaVers.startsWith("1.4"))  {
        try {
            //  Look around for the 1.4.X plugin proxy detection class... Without it, cannot autodetect...
            Class t = Class.forName("com.sun.java.browser.net.ProxyService");
            com.sun.java.browser.net.ProxyInfo[] pi = com.sun.java.browser.net.ProxyService.getProxyInfo(sampleURL);
            if (pi == null || pi.length == 0) {
                System.out.println("1.4.X reported NULL proxy (no proxy assumed)");
                useProxy = false;
            else {
                System.out.println("1.4.X Proxy info geProxy:"+pi[0].getHost()+ " get Port:"+pi[0].getPort()+" isSocks:"+pi[0].isSocks());
                useProxy = true;
                proxyIP = pi[0].getHost();
                proxyPort = pi[0].getPort();
                System.out.println("proxy " + proxyIP+" port " + proxyPort);
        catch (Exception ee) {
            System.out.println("Sun Plugin 1.4.X proxy detection class not found, will try failover detection, e:"+ee);
            invokeFailover = true;
    else {
        System.out.println("Sun Plugin reported java version not 1.3.X or 1.4.X, trying failover detection...");
        invokeFailover = true;
    if (invokeFailover) {
        System.out.println("Using failover proxy detection...");
         try {
            String proxyList = ((String)System.getProperties().getProperty("javaplugin.proxy.config.list")).toUpperCase();
            System.out.println("Plugin Proxy Config List Property:"+proxyList);
            useProxy = (proxyList != null);
            if (useProxy) {     //  Using HTTP proxy as proxy for HTTP proxy tunnelled SSL socket (should be listed FIRST)....
                // 6.0.0 1/14/03 1.3.1_06 appears to omit HTTP portion of reported proxy list... Mod to accomodate this...
                // Expecting proxyList of "HTTP=XXX.XXX.XXX.XXX:Port" OR "XXX.XXX.XXX.XXX:Port" & assuming HTTP...
                if (proxyList.indexOf("HTTP=") > -1)
                     proxyIP = proxyList.substring(proxyList.indexOf("HTTP=")+5, proxyList.indexOf(":"));
                else proxyIP = proxyList.substring(0, proxyList.indexOf(":"));
                int endOfPort = proxyList.indexOf(",");
                if (endOfPort < 1) endOfPort = proxyList.length();
                proxyPort = Integer.parseInt(proxyList.substring(proxyList.indexOf(":")+1,endOfPort));
                System.out.println("proxy " + proxyIP+" port " + proxyPort);
        catch (Exception e) {
            System.out.println("Exception during failover auto proxy detection, autoDetect disabled, e:"+e);
            autoDetectProxy = false;
}Good luck,
Chris

Similar Messages

  • How to access proxy settings in terminal

    I want to use git in the terminal, but unfortunately I'm sometimes (but not always) behind a firewall that requires me to use a proxy server.
    I've successfully set up environments for all these locations, including the proxy settings that are relevant in each context, but I'm unable to access them in the terminal (i.e. there's no HTTP_PROXY environment variable). My idea is to 'inherit' the system wide proxy settings in the terminal and use them to configure git.
    Is there any way to access the proxy settings in the terminal.

    In you home directory, create a file called .bash_profile (notice the leading dot)
    nano .bash_profile
    add to that file
    export HTTP_PROXY="http://your.proxy.information:nnn"
    Save the file
    Restart the Terminal session.
    Command line Git should work via the environment variable you just created.
    NOTE: you will need to use
    ls -a
    to see the .bash_profile in a Terminal session, and because the leading dot makes it an invisible file, the Finder will not show it without some magic Finder Foo

  • OSB - Accessing Operational Settings within Proxy Service

    Does anyone know if it is possible to access Operation Settings from within a Proxy Service?
    The use case is instead of logging, we perform auditing by inserting into a database. In certain environments, we would like to turn this off. I would like to reuse the Logs logging level field to decide whether or not to audit.
    So the message flow would have if (auditLevel = 'Warning') then BusinessService callout for auditing.
    Doing it this way lets operations choose whether or not to audit, instead of making code changes in different environments to choose whether or not to audit.

    Few months back I was also working on a similar requirement where client did not want to go for OSB configuration change (and even update) for changing the log levels or start auditing. After researching a little bit, we implemented java callout which used to read a property file and provide the value of auditing flag at runtime. We also created a java utility which used to clear the cache of server (because server loads & caches the property file after each restart). So whenever we have to make a change in auditing flag, we just change the value in property file and clear the cache of the server. This makes the fresh copy of property file available in server cache and OSB java callout picks the same.
    It was quite complex but the only better solution we could find. Please let us know if you get something better.
    Regards,
    Anuj

  • Can lync client use internet proxy settings to proxy edge servers, if direct access is not reachable?

    Hi everybody I am trying to Login with my lync Client out of my organization. So I am using lync as a remote user. I am in another organization, and I am using their coporate lan wired and wireless, but I cannot Login to lync in my organization.
    I see that I cannot Access my edge Server on port 443 to authenticate directly, I know that Client in this organization use Internet Proxy to browse the Internet. they have a .pac in their ie Settings.
    my question is; can lync Client use Internet Proxy Settings to reach the Destination? I mean the Access edge on port 443?
    or it can use only Client direct Access to reach the edge Servers?
    I Think that the answer is that I use tcp protocol and not http, and maybe that is the reason why I cannot use the Internet Explorer Proxy Settings to reach the Access edge Servers, different maybe is the case I Need to reach the reverse Proxy for live Meetings.
    Hope my question is clear.
    Thanks

    Proxy settings are used to tell Internet Explorer the network address of an intermediary server (known as a proxy server) that is used between the browser and the Internet on some networks.
    Lync client doesn’t use Internet Proxy Setting. You need to access the Edge service directly.
    Lisa Zheng
    TechNet Community Support

  • Proxy settings in NWDS 7.1 EHP1 for accessing ES workplace

    hi
    I have done the service registry settings in NWDS to access the ES workplace.  i have selected the option "direct connection to internet" in the general-> network connections settings.when i am working from my home this is working fine. but the same thing when i do in my company it is not working. .so how do i find out the correct proxy settings to enter, in order to access in from my company intranet. i tried putting the proxy setting mentioned in the blog ( blog of rudolf held on " How to Consume an Enterprise Service from the ES Workplace in Web Dynpro in the new SAP NetWeaver Composition Environment 7.1". )but it did not work. any suggestions?
    thanks
    sankar

    Hi Ronniee,
    I m trying to implement RFC lookup functionality in Adapter Module.
    Hence I have exposed RFC as a webservice. I have a WSDL now
    In older version of NWDS (7.0), we used to create deployable proxy project in web service perspective, refer below link
    http://help.sap.com/saphelp_nw04/helpdata/en/2d/b9766df88f4a24967dae38cb672fe1/content.htm
    But now I m supposed to implement similar functionality using NWDS 7.1. But unable to understand how to consume web service
    Any input?
    Thanks
    Mugdha Kulkarni

  • Why won't the proxy settings be created in the keychain access?

    Hello,
    I'm having an issue with an iMac that won't keep the proxy settings saved. My company has proxy settings active to use the internet and for some reason they will not stick. I noticed that the keychain access is not creating this internet password and I also noticed it's only happening for a certain user only. In the administrator profile, the keychain is working perfectly fine so I narrow it down to the profile issue. Any suggestions?
    Thanks,

    Network settings apply to all users on the system. Administrator privileges are required to change them.

  • I can not access a website after downloading the new firefox, and I tried changing the proxy settings and it isnt working. How do i re-downlaod the old firefox?

    I am trying to access course compass. It is a school website and is only compatible with firefox 3. I upgraded to firefox 4 and now i cant access the website. I have tried to change the proxy settings but that didn't work. I tried to download an older version of firefox and firefox wouldn't let me. I just need to access this website.

    hello rotary, please see [[Fix problems connecting to websites after updating Firefox]]

  • Access Connection - proxy settings

    Since one of the last updates, access connections do not switch proxy setings (IE ans FF). All other network settings will switch correct, but not proxy...
    Why is'nt lenovo/ibm able to convert proxy exceptions for Firefox? As it proxy settings was changed (before the latest update), in access connections used thy ";" as separator also in firefox, this can not work. ff need ",".
    Please make access connections woking as soon as possible. Its one of the main features i loved/need at my thinkpad...

    Noone working with access connection with the same problem?

  • Where are the proxy settings. can't access my school net.

    I need to change the proxy settings to access my school net!

    See [http://webcazine.com/4949/2-ways-to-configure-proxy-server-on-firefox-for-android/ 2 Ways to Configure Proxy Server on Firefox for Android]

  • I use the proxy settings add-on in Firefox to access my company server. However, I updated Firefox this morning to the latest version. Now this add-on doesn'tl.

    I used the proxy settings add-on to access the company server and wi-fi with my Android 2.36 phone.
    This morning I updated Firefox. The add-on doesn't work anymore. I uninstalled it and went to the add on website to reinstall what I thought must be a new version. This add-on doesn't seem to exist anymore.
    How do I change proxy settings with the new version of Firefox for Android?

    The author of the add-on will need to update their version to be compliant with our newly rewritten Firefox for Android product.
    The new version of Firefox does not provide a user-interface for manipulating proxy settings.
    On the other hand, you can manipulate these settings yourself at your own discretion by visiting the URL about:config and searching for network.proxy
    http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries

  • I used to access internet in mozilla firefox 9 with no proxy settings,now it works well under proxy server. but i can not access it in no proxy. help plz

    i tried disabling windows firewall, and tried to add firefox in firewall also, but none of these works.

    You can try to set '''Auto-detect proxy settings for this network''' in '''Tools''' ('''Alt''' + '''T''') > '''Options''' > '''Advanced''' > '''Network''' > '''Settings'''. If it's still not working you may have to contact the network provider.
    [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel?as=u Options > Advanced]
    [https://support.mozilla.org/en-US/kb/Options%20window Options]

  • How to use proxy settings for one website

    Hello,
    I have to access the only one website using Proxy settings and for others I don't need proxy to access. Is there a way to configure the internet settings to allow one website using Proxy... Please advise. Thanks!
    Regards,
    Aravin S

    I am also getting this "error".  The printer (8500 A910) connected to the web well enough that it went out and supposedly downloaded a new update, but then it was supposed to print a page showing the email address, but did not.
    So I go in and try to set up the eprint, and it tells me it cannot connect to the sever and I'll need to enter a proxy address and port number.  But my ISP's cable modems do NOT have any static IP address nor do they provide any sort of proxy service.  Everything works just fine with "automatic discovery" (DHCP) for every computer in the house.  No problems there.
    So, since  that's the case, of course I cannot look up some proxy address and port number in my web browser because they're all set up for "automatically detect settings".
    What's baffling is that the printer connected to something at HP to download the "update", and it went through a process that appeared to be what I'd expect it to do if it was updating its firmware.  But it won't connect to whatever it's supposed to connect to to have an email address assigned.
    Does HP supply a proxy server?  If so, what's its IP address or URL, and what port should a person set the printer to try to use?
    UPDATE:
    It appears that the HP site must have just been "down" for about six or seven hours while I was trying to get the printer to connect because it now connected and I got an email address asigned without needing to have any "proxy" stuff set up at all.  It's a shame that the printer does not simply report "HP Site down - try again later" instead of reporting that you need to use a proxy when that's impossible.
    "Now, on to the next problem which is that my emails to the assigned address are all bouncing with a "550 5.7.1 Command rejected" error!

  • How to make proxy settings in solaris 10 i386

    Dear Sir,
    I need your help in making proxy settings in solaris 10 x86, as well as on SPARC.
    i installed on virtual machine, and later i wanted to do the same on M4000 server. please help.
    Why I need to set proxy?
    I am on a co-orporate network, and it requires proxy to use internet to download packages for sun directly from sun machine.
    What package I want to download?
    I want to dowload CUPS to configure LINE PRINTER(ALIS5180).
    What did i do to configure line printer?
    1, i installed sun solaris 10 on a dell server to make it as a "print server"
    2, with the print manager I configure "alis5180"
    3, give the print command to test the printing.
    4, I did not got success, coz it is not printing the document i want, it is printing junk.
    5, i clear the cache of alis5180 printer.
    6, reset all the emulations ANSI, IBM Proprinter III XL, Epson FX-1180, Printronix® P600 & P 5000/6000, DEC® LG01, HP 2564C, Tally line/dot matrix printer, Epson FX 1180,
    MTPL, contextual arabic, Twinax (IBM 4234/4210/5225)/Coax(IBM4234), HP LineJet HPLP Series, HP 256X no success.
    Conclusion:-
    This is why I want to configure cups. and I need internet access on the print server to download the this package, and it require internet connection.
    Regards,
    Mky
    Edited by: user9007339 on Jan 22, 2012 3:29 AM

    You could try the Dell site, but I doublt if they will have a driver for Solaris, Linux maybe but not Solaris. Otherwise try the DriverGuide web site. http://www.driverguide.com/
    You could also try installing OpenSolaris if you don't specifically need Solaris 10. Better chance that OpenSolaris will support the NIC.

  • BizTalk published WCF service throwing HTTP 404 error using ISA reverse proxy settings

    I have published my schemas as a WCF service from BizTalk 2010 "Publish WCF Service" wizard. I used Wcf-basicHTTP adapter in receive port. I am able to run the service successfully on localhost IIS and I tested my biztalk solution by sending request using SOAP UI and got response successfully.... Now: Actually, I need to give this service endpoint to my vendor who will send request from outside my company's network i.e. internet. In my infrastrucrue BizTalk is behind the firewall so, we setup a REVERSE proxy server at DMZ layer and it is configured properly. I have tested a simple WCF service by replacing the localhost with Proxy server configured address <DNSName> and it worked absolutely fine. But when I change localhost in my BizTalk schema based published WCF service it is not working and I am getting following error. Really strugling to get it resolved. I wasted a whole 3 days....very upset. Please help me out by giving the detailed step solution. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /BizTalkServiceInstance/MyService.svc I am surprized why other c# code based WCF services are working fine with reverse proxy settings. Server Error in '/' Application. The resource cannot be found.Is there any special things to consider Biztalk exposed wcf servcie over ssl in IIS cluster with ISA

    Hi Singam :)
    First I would start by browsing any other files (files other than the one from WCF) just to ensure that the reverse-proxy’s redirection rules are set correctly. If you get the same 404 error when you try to access other service/files “through reverse-proxy”,
    then it’s an issue in the redirection rule(s) in reverse-proxy.
    If others are fine i.e. no issue in reverse-proxy setup as such, then try the following for WCF service's web.config file. I have seen this issue in WCF service (not just BizTalk’s artifacts exposed as service in reverse-proxy). Add serviceHostingEnvironment
    config as show with in serviceModel section.
    <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Windows 8 and IE10 not accepting Proxy Settings via Group Policy

    We have recently introduced a couple of Windows 8 computers in our network, and we are having issues applying the Internet Explorer Proxy Server settings.
    We use a Microsoft TMG 2010 server as our proxy server for accessing the internet.
     We have been using a GPO with the following settings to automatically configure our Windows 7 computers running IE9 with the appropriate Proxy settings:
    User Configuration\Policies\Windows Settings\Internet Explorer Maintenance\Connection/Proxy Settings
    “Enable Proxy Settings” : Checked
    “Address of proxy” : server.domain.local
    “Port” : 8080
    “Use the same proxy server for all addresses” : Checked
    “Exceptions” : Here we have a list of several internal or partner sites that should not be proxied.
    This GPO has worked beautifully for our Windows XP and Windows 7 users with IE 7, 8 and 9.
     Now with Windows 8 and IE10, this no longer works. 
    I’ve therefore added a Windows Server 2012 Domain Controller to the network, and using GPMC on that new DC, I created a new GPO with the following settings:
    User Configuration\Preferences\Control Panel Settings\Internet Settings\Internet Explorer 10
    Now, seeing as these are preferences, it’s a little different.  But, I’ve “checked off” the option “Use a proxy server for your LAN” as well as “Bypass proxy server for local addresses”. 
    Then I click on “Advanced” and setup all my proxy settings the way I would like them, including the proxy server name, port and exceptions list.
    When this new group policy gets applied to my Windows 8 PC, the only setting that gets applied is the “Use a proxy server for your LAN”. 
    It does not configure the name or port of the proxy server nor does it configure the exceptions list. 
    If I go back to the GPMC, and edit the new GPO, the settings are all there. 
    However, if I just view the settings from the main GPMC screen (without opening the GPO itself), 
    I don’t see all of those settings (again, only the one “Use a proxy server…”)
    What am I missing???

    Hi All, - (Revised Answer by myself)<o:p></o:p>
    I banged my head against the keyboard on this one for some time trying to get this group policy to apply.  I
    did every thing that was suggested, learning about the F6 and F7 keys to Green underline and Red underline the options required and not required.  I even gave in and used the registry settings and it still did not work.  It turned out that I had
    2 issues.  The first one is obvious and the second not so obvious, this is how it is setup:
    I have a 2012 R2 Standard DC with Windows 8.1 clients/workstations and IE 11.  As you are aware you must make
    sure that the following are underlined in green:
    Automatically detect settings - (but not ticked)<o:p></o:p>
    Use proxy server for your LAN<o:p></o:p>
    Bypass Proxy for local address<o:p></o:p>
    Next I made sure that the following had red dotted lines:
    Address<o:p></o:p>
    This still didn't work, so I went through my 'Do Not use proxy servers for addresses beginning with' removed all
    of these and then re-added one by one until the problem materialized.  The first issue was when using wildcards I had added an entry with the following:
    http://domain.subdomain.com/*
    Then caused my proxy fields not to be applied, I re-added this just with:<o:p></o:p>
    http://domain.subdomain.com/
    <o:p>This next one is IMPORTANT.</o:p>
    I had these entries in a Word document of which I had copied and pasted from the entry box for 'Do
    Not use proxy servers for addresses beginning with'.  As shown in the screen shot above provided by SVEN_BURGER I had very similar entries:
    http://domain.subdomain.com/;10.*.*.*;172.27.*.*;http://172.27.*.*
    Each time I copied and pasted the line (+ more) above the proxy field on the Windows 8.1 client
    be blank after using 'gpupdate /force' I then noticed that in my Word document the whole string was being seen as 1 URL due to the http part at the beginning, so I changed my entry to look like this:
    10.*.*.*;172.27.*.*;http://172.27.*.*;http://domain.subdomain.com/
    I again noticed that this section:
    http://172.27.*.*;http://domain.subdomain.com/
    Was being seen as one URL in my Word document.  To resolve this I had to add the URL's individually and
    apply and OK these before going back in and making the next entry.  So I ended up adding them all individually after separating the
    URL's in my Word document.
    I hope this helps.

Maybe you are looking for

  • Why can't iMovie 09 open a project created in an earlier version of iMovie?

    I recently bought a new (intel) iMac with iMovie 09 to replace our old (PowerPC) iMac G5. I had created several movie projects in iMovie on the old iMac, but these are apparently unreadable on the new one. I presume this may have something to do with

  • How to display item procedure results in Search results?

    I have a custom item type based on Image that displays a thumbnail instead of the image itself. This is accomplished using a procedure call and displaying the results with the item and modifying the region attributes to omit the image, but when the i

  • SO Exception in Oracle 8.1.6

    Hi, I'm trying to create Connection Pool for my Entity Bean.. I'm using OracleDriver in weblogic.jar .. DBURL - jdbc:oracle:thin:@localhost:1521:ORCL Driver - oracle.jdbc.driver.OracleDriver properties - user=system server=localhost when it targeted,

  • Suggestion for fixing settings problem in iOS

    put a password lock on the settings button.     this is the only way to make the system work properly for people with intellectual learning disabilities who randomly change language and accessibilities setting outside the restricted area.  Just put a

  • How to fix a iPod touch 4th generation lock button?

    so I went to apple to see if they could fix my lock button. They said i would have to pay a replacement cost of $99 and i already did to because I cracked the screen a few months ago. So there is no way that i will pay it again, IS THERE ANY OTHER WA