Solved

Using HttpURLConnection/Apache Http Client on particular outbound port

Posted on 2009-04-13
2
906 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
ejb wildfly example 2 27
OSPF - Convergence & Downtime 9 37
MSSQL server connection  forced closed 3 38
restrict decimal places for double datatype 10 22
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

828 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