This discussion is archived
3 Replies Latest reply: Apr 2, 2013 5:13 AM by EJP RSS

Java and VPN

978140 Newbie
Currently Being Moderated
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 Journeyer
    Currently Being Moderated
    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 Expert
    Currently Being Moderated
    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 Guru
    Currently Being Moderated
    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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points