Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 443015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:07:44+00:00 2026-05-12T21:07:44+00:00

I have a kind of Http-Gateway app, which acts as an http client towards

  • 0

I have a kind of Http-Gateway app, which acts as an http client towards servers outside our local network.

There is going to be a network configuration upgrade, and I’m going to have problems because:
– there are multiple network cards on client machine
– firewall/nat rules use hardwired ip addresses

If I could programmatically force HttpUrlConnection object to use a specific ip address, I would be ok. But I’m afraid it can’t be done.

Am I right? If not, which version of JRE supports it?

Other possible solutions, preferably ones which don’t involve rewriting everything from scratch?
The simpler the better: I know, there is Apache HttpClient, or I could use Sockets…

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:07:44+00:00Added an answer on May 12, 2026 at 9:07 pm

    I can see no good solution but have two poor possibilities:

    1. Proxy the connections locally:

      Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(
              "proxy", 5555));
      URLConnection urlConnection = url.openConnection(proxy);
      
    2. Register a custom URLStreamHandlerFactory with java.net.URL. Whenever openConnection() is called on the URL it would be handled by this registered custom factory, giving you control over details of the socket connection. Either use Apache’s implementation or roll your own?

      Url.setURLStreamHandlerFactory(URLStreamHandlerFactory fac)
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have below kind of dashboard in my app which i would like to
I have used this code (kind of tutorial) at http://code.google.com/p/gwt-examples/wiki/gwt_hmtl5 ... In this code,
I have this chunk of javascript that's kind of hacked around from http://www.developphp.com/view.php?tid=1248 and
I have kind of library which uses a bunch of its own perf counters.
i have this kind of string into my db http://www.mydomain.com/assets/Image/......./image.jpg and would like to
I have kind of an unique situation. I have developed a cakephp app and
in our application we have some kind of online help. It works really simple:
Hey I designed a help activity and I have kind of parents (groupItems) which
I have kind of a n00b problem, I can't seem to make HTTP GET
Is there any way to have kind of Jyjamas(Java thing!!) where python has something

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.