File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect TCP/IP Socket

 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 2488
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
pic.jpg
Required design
[Thumbnail for pic.jpg]
 
Tim Moores
Bartender
Pie
Posts: 2488
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a proxy written in Java can do that.
 
dushantha Rathnayake
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 2488
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure you can find relevant material yourself by searching for "java proxy server" or some such phrase.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic