Relays HTTP data between a remote host and a local client.
This class supports both HTTP and HTTPS.
Inheritance: Org.Mentalis.Proxy.Client
Exemplo n.º 1
0
	///<summary>Called when there's an incoming client connection waiting to be accepted.</summary>
	///<param name="ar">The result of the asynchronous operation.</param>
	public override void OnAccept(IAsyncResult ar) {
		try {
			Socket NewSocket = ListenSocket.EndAccept(ar);
			if (NewSocket != null) {
				HttpClient NewClient = new HttpClient(NewSocket, new DestroyDelegate(this.RemoveClient));
				AddClient(NewClient);
				NewClient.StartHandshake();
			}
		} catch {}
		try {
			//Restart Listening
			ListenSocket.BeginAccept(new AsyncCallback(this.OnAccept), ListenSocket);
		} catch {
			Dispose();
		}
	}