Stack Exchange
TrotiNet understanding the code
I have bit confusion on this c# code.This code is from http://trotinet.sourceforge.net/ 
Can some one make me understand .. 
int port = 12345;
bool bUseIPv6 = false;

var Server = new TcpServer(port, bUseIPv6);
Server.Start(**TransparentProxy.CreateProxy**);

Transparent Proxy class : 
public class TransparentProxy : ProxyLogic
{
    public TransparentProxy(HttpSocket clientSocket)
        : base(clientSocket) 
    {
    }

    static new public TransparentProxy CreateProxy(HttpSocket clientSocket)
    {
        return new TransparentProxy(clientSocket);
    }

    protected override void OnReceiveRequest()
    {
        Console.WriteLine("-> " + RequestLine + " from HTTP referer " +
            RequestHeaders.Referer);
    }

    protected override void OnReceiveResponse()
    {
        Console.WriteLine("<- " + ResponseStatusLine +
            " with HTTP Content-Length: " +
            (ResponseHeaders.ContentLength ?? 0));
    }
}

Since CreateProxy is static method with parameters, but the method was called from the main program without parameter. This example app works fine so I am bit confused. So, can someone make me understand :) 
Thanks !   

Your TcpServer.Start methods takes a delegate as a parameter.
This means that it only takes the method to execute, but executes it later in the Start method.
this is the signature of the Start method (you can find it online on github):
public void Start(OnNewClient onConnection)

and as you can see, the OnNewClient is a delegate:
public delegate AbstractProxyLogic OnNewClient(HttpSocket ss)

So the parameter here is a method that has the same signature as the one declared by the delegate.
You can see the source code of the TcpServer class here:
https://github.com/krys-g/TrotiNet/blob/master/Lib/TcpServer.cs

How can I create an instance for this TransparentProxy class ? I dont want to create a Socket because Socket will be created automatically and I need to add a Event handler which can pass to Response content to the upper level (in this case program.cs)

The TrotiNet.TcpServer class defines the following members:
public delegate AbstractProxyLogic OnNewClient(HttpSocket ss);

public void Start(OnNewClient onConnection)
{
    // ...
}

So the TcpServer.Start() method takes a delegate parameter.
The method TransparentProxy.CreateProxy() matches the signature (TransparentProxy inherits from AbstractProxyLogic), so the method is not called, it is passed as delegate.

How can I create an instance for this TransparentProxy class ? I dont want to create a Socket because Socket will be created automatically and I need to add a Event handler which can pass to Response content to the upper level (in this case program.cs)
