File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Redirect TCP/IP Socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Redirect TCP/IP Socket" Watch "Redirect TCP/IP Socket" New topic
Author

Redirect TCP/IP Socket

dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103
Hi,

I am trying to re direct a connected TCP/ IP socket into another host. What is the possibility of this task? please give me your help.

Thank you.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
You can either run a proxy server on that port (which essentially reads incoming data on that port and sends it to a different port), or you can have your firewall/router do that (in which case you'd be looking for a feature called port forwarding).
dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103
Hi Tim,

Thank you for your reply. But in this case I want to do redirect the connected socket into another host. Then the second host can process the request and send the response to particular client. No need to come again to first host. Can we do that using java?

Thank you.



[Thumbnail for pic.jpg]

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Yes, a proxy written in Java can do that.
dushantha Rathnayake
Ranch Hand

Joined: Feb 27, 2010
Posts: 103
Hi,

Really? wow. Can you please give me a link or any helpful document for do this. And thank you very very much.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I'm sure you can find relevant material yourself by searching for "java proxy server" or some such phrase.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect TCP/IP Socket