Urlconnection Problem / more local IP's

Discussion in 'Java' started by Testbm, Oct 11, 2004.

  1. Testbm

    Testbm Guest

    Hello,
    i have got a problem. I have virtuell IP's on a mischine, and I want use one
    special IP for outgoing requests with UrlConnection. Does anyone know, how I
    can do it.


    Greetings Markus
     
    Testbm, Oct 11, 2004
    #1
    1. Advertising

  2. Testbm

    John Davison Guest

    Testbm wrote:
    > Hello,
    > i have got a problem. I have virtuell IP's on a mischine, and I want use one
    > special IP for outgoing requests with UrlConnection. Does anyone know, how I
    > can do it.
    >
    >
    > Greetings Markus


    I spent a little bit of time looking into this. After reading through
    some of the source code for HttpURLConnection, URLConnection and URL, it
    looks like you would need to create a custom URLStreamHandler (which
    bind()s to the IP address you want when you connect) to pass to a URL
    constructor, of which later you would use getConnection() to obtain the
    HttpURLConnection.

    Investigating the source code to these classes should lead you to the
    result you want.

    John Davison
     
    John Davison, Oct 11, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcelo

    URLConnection problem

    Marcelo, Nov 30, 2005, in forum: Java
    Replies:
    2
    Views:
    3,457
    Marcelo
    Nov 30, 2005
  2. Michael
    Replies:
    4
    Views:
    466
    Matt Hammond
    Jun 26, 2006
  3. Replies:
    2
    Views:
    3,709
  4. rubikzube*
    Replies:
    4
    Views:
    919
    Gordon Beaton
    Feb 26, 2007
  5. Robert Klemme

    With a Ruby Yell: more, more more!

    Robert Klemme, Sep 28, 2005, in forum: Ruby
    Replies:
    5
    Views:
    236
    Jeff Wood
    Sep 29, 2005
Loading...

Share This Page