
June 3rd, 2003, 01:35 PM
|
 |
Contributing User
|
|
Join Date: Jan 2003
Location: USA
|
|
|
Yeah, looks like you have the right idea.
I did something similar in my first serious project. I needed to write an embedded telnet client (ie, add telnet-client capability to an existing test application), so I first wrote MiM ("man in the middle") with which I wanted to capture the negotiating that goes on at the beginning of a telnet session in order to understand what my embedded client would have to do.
In effect, MiM was both a server and and client; its server side listened for our client to connect, whereupon it would start its client side to connect to the actual server. Then basically one side would receive a packet and pass it to the other side who would then send it. And when the client disconnected, MiM would disconnect from the actual server. If there is any extra functionality needed (eg, MiM would log each packet's contents to a disk file, a proxy server may cache or filter the packet), then it can easily be added.
|