public HttpListenerRequestWrapper(HttpListenerRequest httpListenerRequest, IPrincipal user)
 {
     _httpListenerRequest = httpListenerRequest;
     _qs      = new NameValueCollection(httpListenerRequest.QueryString);
     _headers = new NameValueCollection(httpListenerRequest.Headers);
     _cookies = new CookieCollectionWrapper(_httpListenerRequest.Cookies);
     User     = user;
 }
Exemplo n.º 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();
        }