Concurrency in urlconnection using multiple proxy server

hi,
I am working on a web application project and need to set up different proxy server for different organization. I know that System.getProperties() will make proxy server work in urlconnection. However, since users from different organization may access our website concurrently, I think System.getProperties() needs to be synchronized through whole setting-proxy-properties----making-urlconnection----removing-proxy-properties working flow. so it will affect scalability of our website,right? any better solutions?
Thanks,
Dean

I just found a solution by subclassing sun package classes so that you can create url connection without affecting system.properties.
URL url =
new URL(null, urlSpec,
new ConcurrentProxyHandler(proxyHost,proxyPort));
//File: ConcurrentProxyHandler.java
//override connection of sun.net.www.protocol.http.HttpURLConnection import java.io.PrintStream;
import java.io.IOException;
import java.net.URL;
/** open an http input stream given a URL */
public class ConcurrentProxyHttpURLConnection extends
sun.net.www.protocol.http.HttpURLConnection {
protected ConcurrentProxyHttpURLConnection(URL u,
ConcurrentProxyHandler handler)
throws IOException {
super(u, handler);
public void connect() throws IOException {
if (connected) {
return;
try {
http = new sun.net.www.http.HttpClient(url,
((ConcurrentProxyHandler)handler).getProxy(),
((ConcurrentProxyHandler)handler).getProxyPort());
ps = (PrintStream)http.getOutputStream();
} catch (IOException e) {
throw e;
// constructor to HTTP client calls openserver
connected = true;
//File: ConcurrentProxyHandler.java
//override openConnection of sun.net.www.protocol.http.Handler and provide accessor for proxyHost
//and proxyPort
import java.io.IOException;
import java.net.URL;
public class ConcurrentProxyHandler extends sun.net.www.protocol.http.Handler {
public ConcurrentProxyHandler (String proxy, int port) {
super(proxy, port);
protected java.net.URLConnection openConnection(URL u)
throws IOException {
return new ConcurrentProxyHttpURLConnection(u, this);
protected String getProxy() {
return proxy;
protected int getProxyPort() {
return proxyPort;

Similar Messages

  • I am using a work laptop and have the same problem. When I try to change the "configure proxy", they only available option is "use this proxy server for all protocols". Could it be that my system administrator blocked me from changing it since they don'

    I am using a work laptop and have the same problem. When I try to change the "configure proxy", they only available option is "use this proxy server for all protocols". Could it be that my system administrator blocked me from changing it since they don't want us to use Firefox.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.4; FNGP_SYS)

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")

  • A new version of Firefox, which downloaded automatically, says Firefox is configured to use a proxy server that's refusing connections, even though I had access before the download.

    I was using Firefox earlier in the day with no problem. About half an hour ago I tried to get on the Internet using Firefox (as always). When I did, I was greeted with a little dialog box showing that something was downloading. That's happened before.
    This time, though, I was greeted by an error page that said Firefox was configured to use a proxy server that's refusing connections.
    I'm not on a network. I have a desktop computer that connedts to a wireless modem that I share only with my wife. I didn't change my settings on either. Neither did my wife.
    My "Connection Settings" box still says "use system proxy settings." There are no entries in the manual settings boxes.
    I want to emphasize that I changed *nothing.*
    I need to know, please, how I can set my computer to get back onto the Internet or, failing that, how I can go back to the previous version of Firefox.
    Thank you very much.
    Bob Murdich

    You can find the connection settings in Tools > Options > Advanced : Network : Connection
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    * [[Firefox cannot load websites but other programs can]]

  • I am running Firefox 3.5.4. When I try to upgrade to a newer version I get "Firefox is configured to use a proxy server that is refusing connections." Then, I have to re-install 3.5.4 to get to the internet. I have Windows XP. How do I fix this?

    Any version of Firefox above 3.5.4 I try to install will not let me get to the internet. Each Firefox gets upgraded it keeps giving me the error message that "Firefox is configured to use a proxy server that is refusing connections." Then I need to re-install 3.5.4 to get to the internet. This is driving me nuts! How do I fix this?

    You're welcome

  • The Remote object used on proxy server?

    Hai,
    Iam attended for one interview they asked me one question
    could send me the answer
    The Remote object used on proxy server?

    That's not even a question. What did they really ask you?

  • Facing severe problem in IE10 of automatically getting clicked on "use a proxy server" every 5 minutes in LAN Settings whereas it is not required to use any proxy server at all when directly connected through ISP broadband.

    Using Window 8 Pro with IE 10 but facing tremendous problem in LAN settings. Every 5 minutes, it automatically gets clicked on "Use a Proxy Server for the LAN" and am unable to open any page unless the said setting is unclicked. The same applies
    while using Chrome or Firefox browsers.... none of the browsers behave properly and have to repeatedly unclick on proxy server settings (in IE or Chrome) and change settings on Firefox.
    Any suggestions to get rid of this problem...??? Thanks

    Hi,
    It seemed that some malware changed your registry which make proxy server enabled.
    Did you install any proxy agent software recently? If you did, please try uninstalling it now. And then make a full scan
    with malware removal tool.
    http://www.microsoft.com/security/pc-security/malware-removal.aspx
    Or locate to registry,
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings, set "ProxyEnable" = dword:00000000.
    For more information, you can refer to
    http://support.microsoft.com/kb/819961
    Andy Altmann
    TechNet Community Support

  • Firefox keeps coming up saying firefox is configured to use a proxy server that is refusing connections. How do I fix this

    When I try to load my firefox page, I keep getting the same message:
    Firefox is configured to use a proxy server that is refusing connections.
    How I do I fix this? I have uninstall firefox and reinstalled and still the same.

    In Firefox 3.6.4 and later the default connection settings have been changed to "Use the system proxy settings".<br />
    You can find the connection settings in Tools > Options > Advanced : Network : Connection<br />
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    *[[Firefox cannot load websites but other programs can]]

  • When i finally connected my mac to work network on windows environment everything related to apple including App store, Safari, software updates, iCloud and iTunes do not work using a proxy server and everything else is working very well

    when i finally connected my mac to work network on windows environment everything related to apple including App store, Safari, software updates, iCloud and iTunes do not work using a proxy server and everything else is working very well including chrome browser…i tried everything but no clue...anybody have solution for this..???

    I also forgot to note that this problem also persists with the new iBooks application. I cannot get past the 'Get Started' screen or access the iBooks Store. Again, all top bar menus are unresponsive.
    DT

  • Just started getting this message but don't know how to correct the problem: irefox is configured to use a proxy server that is refusing connections.

    Firefox is configured to use a proxy server that is refusing connections.

    #Click the big orange Firefox button, or open the Tools menu.
    #Click Options.
    #Go to Advanced.
    #Go to Network.
    #Under Connection, click Settings.
    #Choose No proxy, or Use system settings.
    See also:
    *[[Server not found]]
    *[[Error loading web sites]]
    *[[Firefox cannot load websites but other programs can]]
    *[[Options window - Advanced panel]]

  • I have been using firefox for a long time, today when i tried to launch firefox i recieved "Firefox is configured to use a proxy server that is refusing connections." i dont know how to fix this. I didnt change any settings.

    I have been using firefox for a long time, today when i tried to launch firefox i recieved "Firefox is configured to use a proxy server that is refusing connections." i dont know how to fix this. I didnt change any settings, im the only person who uses this computer

    You can find the connection settings in Tools > Options > Advanced : Network : Connection<br />
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    * [[Firefox cannot load websites but other programs can]]

  • Every time I click on the browser I get a Firefox is configured to use a proxy server that is refusing connections.

    I can't connect to the firefox browser. Every time that I click on the browser I get a " The proxy server is refusing connections. Firefox is configured to use a proxy server that is refusing connections. " I've never had this problem before. I'm now force to use Google Chrome to browse the internet. Can you help me out. Thanks

    You can find the connection settings in Tools > Options > Advanced : Network : Connection
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    * [[Firefox cannot load websites but other programs can]]

  • Firefox is configured to use a proxy server that is refusing connections

    I try to go online with Firefox 4.0 and I keep getting the error Firefox is configured to use a proxy server that is refusing connections. I go to tools then settings then options and click on one of 3 buttons No proxy, auto detect proxy settings for this network, use system proxy settings, and manual proxy configuration if I get rid of the numbers in the boxes. After I check one of them I retry it then it works until I close firefox. When I open firefox again it repeats the same thing all over again.
    I am tired of resetting it over and over again and have been using Internet Explorer because it works fine. I don't know how to make it work. Any ideas what I am doing wrong?

    You can find the connection settings in Tools > Options > Advanced : Network : Connection
    If you do not need to use a proxy to connect to internet then select "No Proxy"
    See "Firefox connection settings":
    * [[Firefox cannot load websites but other programs can]]

  • App store, Safari, software updates, icloud, do not work in Mavericks 10.9 using a proxy server

    App store, Safari, software updates, icloud, do not work in Mavericks 10.9. these problems are interrelated I am sure. Apple apps were working fine in 10.8.5 I could do software updates through a proxy server using password authentication. I reinstalled a new system 10.9 on another partition and it won't let me use Safari or update software using a proxy server. Firefox works fine (I am using it to post). I am very disappointed that this wasn not fully tested BEFORE releasing Mavericks. Any solutions would be greatly appreciated.

    I had this problem myself.
    Checked the system log with Console, and I found the entry:-
    Nov 11 11:16:41 teds-new-mac.ad.mycompany.co.uk ocspd[537]: Authentication challenge received for "10.203.39.212:8080", unable to obtain proxy server credential from System keychain.
    For some unknown reason, Mavericks seems to be looking in the System keychain, when these credentials are actually held in the Login keychain.
    So, I tried "Copy & Paste"  - copying the https user name & password from the Login keychain and pasting into the System keychain, which worked but it's not quite as straightforward as I initially thought.
    Pasting into the System Keychain was, I found a not-very-intuitive process:
    Having opened your Login Keychain, click once on the item to be copied and when it's highlighted, select "Copy" from the Edit menu or, of course, cmd+c.
    Select the System Keychain:- DO NOT CLICK THE PADLOCK IN THE TOP LEFT TO UNLOCK IT.
    From the Edit menu, select "Paste" or cmd+v.
    You will then get a dialogue box,, enter your administrator's password and select "Modify Keychain" or just hit return, as it's the default entry.
    I found a restart was in order before it recognised everything and would accept https pages without alert boxes, but YMMV.
    Funnily enough - and this is where it seems counter-intuitive, if you do click on the padlock and unlock the System Keychain, "Paste" is greyed out in the Edit menu and cmd+v has no effect.
    Exactly the opposite to what I'd expect..

  • When attempting to use Firefox with TOR I get "Firefox is configured to use a proxy server that can't be found."even though neither is configured to use a prox

    After installing TOR Browser Bundle 2.2.37-2, I get "Firefox is configured to use a proxy server that can't be found." even though neither is configured to use a proxy

    Hi,
    If the TOR Browser Bundle is installed you would have two versions of Firefox: the original Mozilla Firefox and the customized TOR Firefox. You can try to start the Firefox that was installed by TOR. If you have security software (antivirus, firewall etc.) installed, you can try deleting all existing instances of TOR and TOR Firefox and its related processes/files in all the different configuration areas/modules of the security software like process monitoring, sub/spawned process control, virtualization etc. in addition to the main AV/Firewall module. Instead create new fully allowed/trusted rules for TOR and TOR Firefox + its related processes. Even otherwise some security software may also ask again when TOR/TOR Firefox is started and you can try to allow/trust at that time. Please see [https://support.mozilla.org/en-US/kb/Firewalls this].
    [http://kb.mozillazine.org/Firewalls AV/Firewalls Configuration]
    [https://blog.torproject.org/blog/new-tor-browser-bundles-20 Support]
    You can also try [https://www.mozilla.org/en-US/firefox/new/ updating the original Mozilla Firefox], set '''No Proxy''' in '''Tools''' ('''Alt '''+ '''T''') > '''Options '''> '''Advanced '''> '''Network '''> [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Advanced%20panel?as=u Settings] and check.

  • Why does my laptop use a proxy server for mozilla or chrome when i check in internet explorer it sais my system isnt but it is it jumps back to a proxy server in mozille when i tick no proxy ?? help please im not wizzy thanks

    Why does my laptop use a proxy server for mozilla or chrome when i check in internet explorer it sais my system isnt but it is it jumps back to a proxy server in mozille when i tick no proxy ?? help please im not wizzy thanks

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    See also:
    *http://kb.mozillazine.org/Preferences_not_saved
    *https://support.mozilla.com/kb/Preferences+are+not+saved

Maybe you are looking for