3 Replies Latest reply: Apr 2, 2013 7:13 AM by EJP RSS

    Java and VPN

    978140
      Hi. I am using an VPN service. But it seems like my java program:
      URL url = new URL("http://...");
      BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
      are still using my original ip address. Any hints on what I can do to make the connection go throw my VPN service?
        • 1. Re: Java and VPN
          aksarben
          I assume you meant to say "it *doesn't* seem to like..."?

          Are you getting an error message? If so, post complete stack trace.
          • 2. Re: Java and VPN
            sabre150
            Hunter_wow wrote:
            Hi. I am using an VPN service. But it seems like my java program:
            URL url = new URL("http://...");
            BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
            are still using my original ip address. Any hints on what I can do to make the connection go throw my VPN service?
            Presumably in the URL specification you are actually using the VPN IP address (or the domain name mapped to that IP address). Also, presumably you have configured the web server to bind to the VPN IP address.
            • 3. Re: Java and VPN
              EJP
              The IP routing table needs to be set up to prefer the VPN if it is running. Not something you can control for HttpURLConnection in Java.