public static HttpListenerProxy Create(int port) { if (!HttpListener.IsSupported) { throw new Exception("HttpListener is not supported!"); } ServicePointManager.DefaultConnectionLimit = 1000; var proxy = new HttpListenerProxy(port); return proxy; }
public static HttpListenerProxy Create(int port) { if (!HttpListener.IsSupported) { throw new Exception("HttpListener is not supported!"); } ServicePointManager.DefaultConnectionLimit = 1000; var proxy = new HttpListenerProxy(port); return(proxy); }
static void Main(string[] args) { //var port = args[0]; int portNo = 8099; //if (!string.IsNullOrEmpty(port)) //{ // portNo = int.Parse(port); //} var proxy = HttpListenerProxy.Create(portNo); proxy.Start(); Console.ReadKey(false); proxy.Stop(); }
static void Main(string[] args) { //var port = args[0]; int port = 8087; var proxy = HttpListenerProxy.Create(port); proxy.Start(); Console.ReadKey(false); //proxy.Stop(); //TcpListenerProxy.RunListener(IPAddress.Parse("192.168.70.118"), 8087); //HttpServer httpServer = new MyHttpServer(portNo); //Thread thread = new Thread(new ThreadStart(httpServer.listen)); //thread.Start(); }