Example #1
0
 private void OnAuthorize(object sender, HttpAuthorizationEventArgs e)
 {
     e.Cancel = !Authorize(
         e.Headers,
         e.RemoteEndpoint,
         IP.GetMAC(e.RemoteEndpoint.Address)
         );
 }
Example #2
0
 private void OnAuthorize(object sender, HttpAuthorizationEventArgs e)
 {
   e.Cancel = !Authorize(
     e.Headers,
     e.RemoteEndpoint,
     IP.GetMAC(e.RemoteEndpoint.Address)
     );
 }
Example #3
0
        internal bool AuthorizeClient(HttpClient client)
        {
            if (OnAuthorizeClient == null)
            {
                return(true);
            }
            if (IPAddress.IsLoopback(client.RemoteEndpoint.Address))
            {
                return(true);
            }
            var e = new HttpAuthorizationEventArgs(client.Headers, client.RemoteEndpoint);

            OnAuthorizeClient(this, e);
            return(!e.Cancel);
        }
Example #4
0
 internal bool AuthorizeClient(HttpClient client)
 {
   if (OnAuthorizeClient == null) {
     return true;
   }
   if (IPAddress.IsLoopback(client.RemoteEndpoint.Address)) {
     return true;
   }
   var e = new HttpAuthorizationEventArgs(
     client.Headers, client.RemoteEndpoint);
   OnAuthorizeClient(this, e);
   return !e.Cancel;
 }