🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

proxy

Started by
0 comments, last by wrathgame 22 years, 8 months ago
Hi all I decided today to write a quick proxy server for mIRC so i can connect though a proxy running at home from uni (at uni im very limited on open ports).. im trying to work out the proxy protocal.. when connecting to my "basic client" mIRC says sends a http type request: CONNECT server name:server port HTTP/1.0 thats all fine and great but how do i then reply and tell it that i have connected to the server etc etc ?? any ideas would be great ;-) Thanks ~tim
~ Tim
Advertisement
I don''t know a lot about the mIRC protocol but you could do something like so:

1. Client connects to proxy.

2. Proxy accepts client and assigns it a socket (via accept/AcceptEx etc).

3. Proxy receives the connection data from client.

4. Proxy then attempts to open a connection to the remote machine (the ''destination.'')

5. From that point, the ''session'' has two sockets. The source (mIRC client), and the destination (mIRC server.)

6. The proxy then posts WSARecv() requests on both sockets (source and destination sockets.)

7. Anything received on the destination socket gets forwarded to the source socket and vice versa.

Technically, that should be all that is required. If the mIRC client requires a response from the mIRC server, the server should provide that information to the proxy (via the destination socket.) The proxy then forwards this data to the mIRC client (via the source socket) and so on.

Typically it helps to have a base class of some sort like:

class ProxyConnection
{
public:
ProxyConnection();
virtual ~ProxyConnection();

// various methods

private:
virtual void OnReceiveFromSource(...);
virtual void OnReceiveFromDestination(...);

SOCKET source_,
destination_
};



Dire Wolf
www.digitalfiends.com
[email=direwolf@digitalfiends.com]Dire Wolf[/email]
www.digitalfiends.com

This topic is closed to new replies.

Advertisement