Solved

Using HttpURLConnection/Apache Http Client on particular outbound port

Posted on 2009-04-13
2
898 Views
Last Modified: 2013-11-21
Hi,
    I use HttpURLConnection and Apache HttpClient in program which submits data to the web server. Whenever the http connection is established b/w client program and web server. the client uses different outbond port on client side. Is there a way for fixed outbond port. B'cos client machine is behind firewall which restricts the random outbond port used by program.
Regards,
Nirav Pradhan

0
Comment
Question by:Nirav_Pradhan
2 Comments
 
LVL 16

Expert Comment

by:The--Captain
ID: 24128754
If you don't see it in the documentation for the API, then no, you probably cannot specify the source port.  I'm guessing there might be lower-level TCP/IP APIs you could access to get this done (if this is a web applet, the security manager might be annoying (is that a problem anymore?)  I haven't written java code in over a decade), but you might end up having to re-invent the wheel (or at least become a serious code-scavenger) in order to implement HTTP protocol functionality while being able to specify a source port.

Does that help at all?

Cheers,
-Jon
0
 

Accepted Solution

by:
Nirav_Pradhan earned 0 total points
ID: 24128813
Dear Jon,

      You're telling its not possible to do so. Even if its possible, I might have to develope myself. I like to do, but the time doesnt permit so. If you get some idea suggest me. I have one solution, that is using proxy server at client machine. Is it correct? The server application runs on particular port, why cant it be possible for the client? If it is, pls suggest how its done.

Regards,
Nirav Pradhan
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 91
Application timeout question 2 37
spanning tree loop even though stp is enabled 10 34
How to simulate latency? 5 30
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question