I'm currently new to C++ and I'm working on a small project of mine.
What I'm trying to achieve is this:
A client attempts to connect to the server on lets say port 2002.
The server listens for the data coming in on port 2002 and just sends that off to another server.
The best way forward for me would be that the "middle man" server makes it look like the packets have come directly from the client.
Ideally, from that point on, the client and the target server talk to each other, but it's not too big a deal if the "middle man" server has to receive the output from the target server and sends that back to the client.
It's almost like a router of sorts.
My problem is that I'm not that clued up on the lower levels of networking. I've done quite a bit of research and found a couple of libraries that I could use, but, not really knowing the facts, I thought I'd ask.
Any advice would certainly be appreciated and I'd be happy to provide more info if I've not given enough detail as to what I'm trying to do.
There have been times when I have had to do this very thing. This depends on if you are writing both the target server and the middle-man server. If you are writing both, just have the target server connect to the middle man, send the client packets to the middle man, receive the response from the middle man, then return those packets to the client.
If you're not writing both, I don't have a solution.
What kooth suggests is a star shape network.
You may want to take a loot at a computer network text book. Any will do, although my school used Tanenbaum's. You'll find info about network geometry and make the decision that suits your project.