I'm no help at reverse engineering, but network programming I'm sure I can help.
Try Google around and you could take a look at my Packet Analyzer (or wait for v3, because it'll be better.)
Also a few good links:



A proxy requires 3 (or more) sockets at all.
1 socket for connection between the server and your proxy.
1 socket for your proxy which is accepting connection.
1 socket for your client connection to your proxy.
Connection:
ProxySocket binds to en endpoint.
ProxySocket connects to the server.
--You login from your client
-- You'll get a connection to the ProxySocket.
ClientSocket should be equal to the socket connecting.
Packet Handling:
Client -> Packet -> Proxy
Proxy -> Packet -> Server
Server -> Packet -> Proxy
Proxy -> Packet -> Client
Basically a proxy is a middle man.