How to use proxy.

How do i implement the use of a proxy in my URLConnection?

  Properties props=System.getProperties();
  props.put("proxySet", "true");
  props.setProperty( "proxyHost", "myproxy.mydomain.com" );
  props.setProperty( "proxyPort", "80" );
  System.setProperties(props);
  URL thisUrl = new URL(addr);
  URLConnection thisConn = thisUrl.openConnection();
  InputStream receiver = thisConn.getInputStream();Just change 'myproxy.mydomain.com' to your proxy server and 80 to whatever port it uses.

Similar Messages

  • How to use proxy for all application in XFCE?

    Hi all,
    Is there any way I can setup a proxy and then all applications over XFCE can use it, just like the Internet Option in Windows?
    I tried "export PROXY=..." in command line and setup proxy for Firefox, but those setting is not for overall system.
    If unfortunately there is no way for global setting, at least please tell me how to setup proxy for svn command.
    Thank you.

    Sign in with whatever Apple ID desired on the device in iMessage setup.
    This has no affect on the Apple ID used for store purchases or iCloud.

  • 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 use proxy in UDF

    In a mapping I need to call an abap proxy with one key field and it will return 5 fields to me. i need to use those five fields in my mapping. How do I use an abap proxy in a UDF ?
    Regards,
    Frank

    Hi Frank,
    AFAIK, You should use RFC Lookup for your requirement.
      1.First create an RFC with one Import parameter and five Export parameters and make it remote enabled.
      2. Use XI's Mapping lookup API's to call the RFC from UDF and get required values and map it to the target fields.
      For more details about RFC and other Lookup API's please refer the following Blogs.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples/xi%20mapping%20lookups%20rfc%20api.pdf">XI Mapping RFC Lookup API</a>
    <a href="/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer">Lookup Blog by Alessandro Guarneri</a>
    <a href="/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler Lookups</a>
    <a href="https://media.sdn.sap.com/javadocs/NW04/SPS15/pi/index.html">SAP XI Lookup API-Help</a>
    Regards,
    Ananth

  • How to use Proxy Settings in swf?

    Hi ,
        I am using swf inside an MFC application. Both MFC applciation and swf can call web pages(some web services). Everything was working fine until my company added a proxy server. I have made changes to the MFC application and that can communicate through proxy server but swf is still not able to call remote services.
    Where should I make changes in swf to call remote service through proxy? I just want to know which class or property should I use? There should be some propety to specify that I want to make a request through Proxy server on some port with a username and password.
    - Rahul

    I've resolved it : proxy settings can be modified in <PT_HOME>/settings/common/serverconfig.xml
    It was not easy to find it, there's no doc talking about this

  • How to use proxy settings to join a Remote Server ?

    I have a problem to configure a Remote Server : my portal is behind a proxy, to access to the remote server, I have to make some proxy settings. I've tried to use -Dhttp.proxyHost and -Dhttp.proxyPort but they have no effect
    It seems like that the portal ignore completely my proxy settings
    Any idea to resolve this ?
    Thanks

    I've resolved it : proxy settings can be modified in <PT_HOME>/settings/common/serverconfig.xml
    It was not easy to find it, there's no doc talking about this

  • How to use an authenticated user for a proxy call

    Dear all,
    I am currently working on a JEE application where the user needs to authenticate (for this I have configured the web.xml).
    Now inside this application I need to do a proxy call to a PI webservice.
    I would like to use the user credentials of the already logged in user in order to call the proxy.
    What I don't want to do is to use a service user for the proxy call.
    The code I am trying to call looks something like this:
         private IntegratedConfigurationIn getPort() throws Exception{
              IntegratedConfigurationIn port = null;
              try {
                   IntegratedConfigurationInService service = null;
                   service = new IntegratedConfigurationInService();
                   port = (IntegratedConfigurationIn) service.getIntegratedConfigurationIn_Port();
                  BindingProvider bp = (BindingProvider)port;
                  bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, user);
                  bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
                  if (url.length() != 0)
                       bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
              catch (Exception ex){
                   ex.printStackTrace();
              return port;
    The examples I found to retrieve the userdata pointed to codes similar to this one:
    public HttpServletRequest getHttpRequest() throws Exception {
              // Get runtime context
              Properties props = new Properties();
              props.put("domain", "true");
              Context initialContext = new InitialContext(props);
              ApplicationWebServiceContext wsContext = (ApplicationWebServiceContext) initialContext
                        .lookup(" /wsContext/ApplicationWebServiceContext");
              HttpServletRequest req = wsContext.getHttpServletRequest();
              return req;
    com.sap.security.api.IUser sapUser = com.sap.security.api.UMFactory.getAuthenticator().getLoggedInUser(getHttpRequest(), null);
              IUser ep5User = com.sapportals.wcm.util.usermanagement.WPUMFactory.getUserFactory().getEP5User(sapUser);
    Now I don't know how to bring it togehter and how to use an authenticated user for the BindingProvider.
    I would appreciate any hints or ideas.

    Peter,
    from the first screenshot, what I understood is that, you are calling an inbound PI web service that is intended to create an integrated configuration object (this is used for whole lot of other reason completely) but not actually calling a development web service.
    For this, you would have to generate your client classes from the WSDL provided by the PI developer for that particular service. Once you get those client classes generated, you could used the method provided in the other screenshot to extract the user and password and call the intended web service.
    Vijay Konam

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • How to bypass proxy when trying to send a mail using javamail smtp

    Hi,
    I am trying to make a servlet send a mail using javamail smtp protocol on port 25 but i m not able to send getting an exception, i suspect proxy is blocking, so any idea anyone how bypass a proxy.

    And if it does turn out that there's a proxy server blocking access to your target SMTP server, the best way to deal with that is to discuss the issue with the person responsible for your network configuration.

  • How to use a deployable proxy to consume a web service?

    HI Gurus,
    I am following this article below which helpfully explains how to create a proxy. So far so good. I have been able to create a proxy. However, the article only describes how to build a proxy.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c7d0f7-153d-2a10-5d96-d334b67cd771
    In the concluding part of the document the author says "In my next article I will tell you how to use this deployable proxy to consume the web service in web application."
    I have looked around the SDN but have not been able to get the next part of this document.
    I have a JSPDynpage application which is required to consume a webservice. I want to use this proxt to consume the webservice.
    Any help or any other document that explains how to use a deployable proxy to consume a web service will be helpful.
    Thanks,
    SB

    Hi,
    Here is an example how to consume the deployable proxy in web application:
    http://help.sap.com/saphelp_nw70/helpdata/EN/ca/c8efe3e8a64163b01924ad4ccd706d/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/5c/971740198d8f5ce10000000a155106/frameset.htm
    Regards,
    Praveen Gudapati

  • How can i use proxy in firefox browser.

    i want to use proxy and its port. but i don't know how to use.so help me as soon as possible

    Type about:config in the address bar. Use the filter to search for proxy and then enter the info for each preference.

  • How to use a proxy with java applications?

    I have a nokia 6300 type s40v3
    hello,
    I would like to know if it is possible to use a proxy of any and how ? kind with java applications.
    thank you

    Well, it works well when, into my applet, i do somethig like this:
    URL url = new URL(host);
    URLConnection connexion = url.openConnection();My applet uses proxy setting from IE6 but only if i use Java 1.4.2_08.
    With IE6 and Java 1.5.04, it doesn't work (my applet doesn't use proxy settings)
    With Firefox and Java 1.5.04, it's ok
    Have you already seen a problem like this with Java 1.5.04 ?

  • How can I set which projects use Proxy Media and not just change every project?

    Hi there
    I can see how to change ALL projects to use Proxy Media or Original/Optimised Media
    in
    Preferences>Playback
    But I'm switching between projects a lot and I only want to use Proxy Media on one project, so how can I tell FCPX to only use Proxy Media on that ONE project?
    Thanks

    Perhaps if apple didn't take back prores LT this wouldn't be as much of an issue.
    Pores LT was a great compromise between file size and quality. It produced a fine image for most peoples needs and was 30% smaller.
    Hopefully it will be returned soon. I can't imagine why it's not already there. Unless they want to charge for it, ... again..
    Have you tried capturing as full res, then change prefs back to proxy, open a new project and import the full res files?
    In FCP7 the render pref was separate from the capture pref. is that gone too?
    If my idea doesn't work, Surely someone will chime in with a creative work around to this.
    And hopefully it'll get fixed soon in an update.
    Best,
    g

  • HT203477 How Use Proxy Media ?

    I chose when importing create proxy media 
    How Use Proxy Media ?

    It's been moved to the Video Display Options – the disclosure triangle in the upper right of the Viewer.
    Russ

  • How to use the Proxy Bypass on an ASA 5510

    Hi
    We have a custom web application which is heavily relying on javascript. We're trying to access it via the webportal but this application does not load correctly (it barely shows a white page).
    the link is https://our.domain.com/oursubdirectory and SUBIF-ISP2 is the public interface facing the internet. This is the rule as displayed by the CLI:
    proxy-bypass interface SUBIF-ISP2 path-mask oursubdirectory target https://our.domain.com/ rewrite none
    Despite having this command in place, nothing changes. I tried multiple combinations adding the xml and hostname rewrite or changing the interface but nothing, the page is the same like if this rule was not applied.
    Any suggestions?
    Thanks!

    Nicola,
    Quite frankly, instead of using proxy bypass you should be trying with smart tunnel.
    Rgerading usage:
    http://www.cisco.com/en/US/docs/security/asa/asa84/command/reference/p.html#wp2205338
    If you have problems with a page - please check that you have latest revision of ASA software avilable, if you do open up a TAC case.
    M.

Maybe you are looking for

  • Time doesn't always appear

    The time under the received column doesn't always appear. If I click on the message, it shows but then goes away. It's very inconsistent. Repairing permissions and restarting doesn't change the behavior.

  • Payment Order Outbound Idoc

    Hi Gurus, I am able to generate IDoc for PEXR2002 for PAYEXT after running payment program in F110. However when I checked the segments, it populates only a few of these segments (which are optional) and other segments are missing. Can anyone tell me

  • Problems with mp3 pen-drives to listen in the car

    Hi everyone, i'm from Italy and a new happy iMac 27" owner by 1 month.. i 'm really glad to have and use this wonderful machine , I come from years and years of Pc-Win. The only thing, for now, that causes some problems is about  saving and listening

  • I forgot my security question you can not buy please help thank you

    I forgot my security question you can not buy please help thank you

  • Can we increase the lenght of Purchase Org. description in config??

    Hi All, In config for creation of purchase organization, currently the allowed lenght for purchase organization description is 20 characters. Is it possible to increase the same? Thanks, Nandan.