- Overwrite the client's login server(s) and port(s) with your loopback IP and the port you want to listen to
- Set up a socket to listen to TCP connections on the port you used earlier
- When a connection is accepted, create a new thread or run the next code asynchronously
- Either read the client's memory or decrypt the packet and read it to determine where to connect, create a new socket and connect accordingly
Remember to alter the character list by modyfing the packet or memory writing! You will have to store the original data and connect accordingly when a client wants to connect to a gameserver - At this point you will be able to inspect, modify, remove and send packets
edit: to clarify, you will need one socket that is listening, one socket for the proxy<->client connection, and one socket for the proxy<->server connection
edit2: also remember to store the original login servers, as you will need to connect to them