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);
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }