public HttpListenerRequestWrapper(HttpListenerContext httpListenerContext)
        {
            _httpListenerContext = httpListenerContext;
            QueryString = new NameValueCollection(httpListenerContext.Request.QueryString);
            Headers = new NameValueCollection(httpListenerContext.Request.Headers);
            Cookies = new CookieCollectionWrapper(httpListenerContext.Request.Cookies);
            ServerVariables = new NameValueCollection();
            User = httpListenerContext.User;

            // Set the client IP
            ServerVariables["REMOTE_ADDR"] = httpListenerContext.Request.RemoteEndPoint.Address.ToString();
        }
Пример #2
0
        public HttpListenerRequestWrapper(HttpListenerContext httpListenerContext)
        {
            _httpListenerContext = httpListenerContext;
            QueryString          = new NameValueCollection(httpListenerContext.Request.QueryString);
            Headers         = new NameValueCollection(httpListenerContext.Request.Headers);
            Cookies         = new CookieCollectionWrapper(httpListenerContext.Request.Cookies);
            ServerVariables = new NameValueCollection();
            User            = httpListenerContext.User;

            // Set the client IP
            ServerVariables["REMOTE_ADDR"] = httpListenerContext.Request.RemoteEndPoint.Address.ToString();
        }