public WebSocketTransportListener(ConnectionListener listener, string host, int port, string path, X509Certificate2 certificate)
{
this.listener = listener;
// if certificate is set, it must be bound to host:port by netsh http command
string address = string.Format("{0}://{1}:{2}{3}", certificate == null ? "http" : "https", host, port, path);
this.httpListener = new HttpListener();
this.httpListener.Prefixes.Add(address);
}