Skip to main content
GameDev.net gamedev.net
🔒 Locked

proxy

Started by wrathgame Oct 10, 2001 at 1:19 PM 0 replies 500+ views
Original Post
wrathgame
wrathgame
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
Dire.Wolf
Dire.Wolf
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.