diff --git a/websocket-sharp/Net/AuthenticationSchemeSelector.cs b/websocket-sharp/Net/AuthenticationSchemeSelector.cs deleted file mode 100644 index a6b307dc..00000000 --- a/websocket-sharp/Net/AuthenticationSchemeSelector.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// AuthenticationSchemeSelector.cs -// Copied from System.Net.AuthenticationSchemeSelector.cs -// -// Author: -// Gonzalo Paniagua Javier -// -// Copyright (c) 2005 Novell, Inc. (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace WebSocketSharp.Net { - - /// - /// Selects the authentication scheme for a instance. - /// - /// - /// One of the values that indicates the scheme used to authenticate the specified client request. - /// - /// - /// A that contains a client request information. - /// - public delegate AuthenticationSchemes AuthenticationSchemeSelector (HttpListenerRequest httpRequest); -} diff --git a/websocket-sharp/Net/HttpListener.cs b/websocket-sharp/Net/HttpListener.cs index 9b4312cc..3c9108b3 100644 --- a/websocket-sharp/Net/HttpListener.cs +++ b/websocket-sharp/Net/HttpListener.cs @@ -55,7 +55,7 @@ namespace WebSocketSharp.Net #region Private Fields private AuthenticationSchemes _authSchemes; - private AuthenticationSchemeSelector _authSchemeSelector; + private Func _authSchemeSelector; private string _certFolderPath; private Dictionary _connections; private List _contextQueue; @@ -124,16 +124,27 @@ namespace WebSocketSharp.Net } /// - /// Gets or sets the delegate called to determine the scheme used to authenticate clients. + /// Gets or sets the delegate called to select the scheme used to authenticate the clients. /// + /// + /// + /// If you set this property, the listener uses the authentication scheme selected by + /// the delegate for each request. + /// + /// + /// If you don't set, the listener uses the value of the AuthenticationSchemes + /// property as the authentication scheme for all requests. + /// + /// /// - /// A delegate that invokes the method(s) used to - /// select an authentication scheme. The default value is . + /// A Func<, > + /// delegate that invokes the method(s) used to select an authentication scheme. The default + /// value is . /// /// /// This listener has been closed. /// - public AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate { + public Func AuthenticationSchemeSelector { get { CheckDisposed (); return _authSchemeSelector; @@ -503,8 +514,8 @@ namespace WebSocketSharp.Net internal AuthenticationSchemes SelectAuthenticationScheme (HttpListenerContext context) { - return AuthenticationSchemeSelectorDelegate != null - ? AuthenticationSchemeSelectorDelegate (context.Request) + return AuthenticationSchemeSelector != null + ? AuthenticationSchemeSelector (context.Request) : _authSchemes; } diff --git a/websocket-sharp/websocket-sharp.csproj b/websocket-sharp/websocket-sharp.csproj index 7ade0e6d..8fe65c31 100644 --- a/websocket-sharp/websocket-sharp.csproj +++ b/websocket-sharp/websocket-sharp.csproj @@ -71,7 +71,6 @@ -