aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-03-07 21:08:57 +0100
committerGitHub <noreply@github.com>2019-03-07 21:08:57 +0100
commit10a0d6bdba821449abfb1d48e9708ba6f3fc6a62 (patch)
tree602be322daedca127ba66de07837ac8e792730a7 /SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs
parentae0ecc1b10982d9240ecdcc82cb7299fc708aafb (diff)
parent0abe57e930e44eab9566991f33b089d1e61cfb83 (diff)
Merge pull request #1010 from cvium/kestrel_poc
Remove System.Net and port to Kestrel
Diffstat (limited to 'SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs')
-rw-r--r--SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs92
1 files changed, 0 insertions, 92 deletions
diff --git a/SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs b/SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs
deleted file mode 100644
index 5ed49ec47..000000000
--- a/SocketHttpListener/Net/WebSockets/HttpListenerWebSocketContext.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Net;
-using System.Security.Principal;
-using MediaBrowser.Model.Services;
-
-namespace SocketHttpListener.Net.WebSockets
-{
- public class HttpListenerWebSocketContext : WebSocketContext
- {
- private readonly Uri _requestUri;
- private readonly QueryParamCollection _headers;
- private readonly CookieCollection _cookieCollection;
- private readonly IPrincipal _user;
- private readonly bool _isAuthenticated;
- private readonly bool _isLocal;
- private readonly bool _isSecureConnection;
-
- private readonly string _origin;
- private readonly IEnumerable<string> _secWebSocketProtocols;
- private readonly string _secWebSocketVersion;
- private readonly string _secWebSocketKey;
-
- private readonly WebSocket _webSocket;
-
- internal HttpListenerWebSocketContext(
- Uri requestUri,
- QueryParamCollection headers,
- CookieCollection cookieCollection,
- IPrincipal user,
- bool isAuthenticated,
- bool isLocal,
- bool isSecureConnection,
- string origin,
- IEnumerable<string> secWebSocketProtocols,
- string secWebSocketVersion,
- string secWebSocketKey,
- WebSocket webSocket)
- {
- _cookieCollection = new CookieCollection();
- _cookieCollection.Add(cookieCollection);
-
- //_headers = new NameValueCollection(headers);
- _headers = headers;
- _user = CopyPrincipal(user);
-
- _requestUri = requestUri;
- _isAuthenticated = isAuthenticated;
- _isLocal = isLocal;
- _isSecureConnection = isSecureConnection;
- _origin = origin;
- _secWebSocketProtocols = secWebSocketProtocols;
- _secWebSocketVersion = secWebSocketVersion;
- _secWebSocketKey = secWebSocketKey;
- _webSocket = webSocket;
- }
-
- public override Uri RequestUri => _requestUri;
-
- public override QueryParamCollection Headers => _headers;
-
- public override string Origin => _origin;
-
- public override IEnumerable<string> SecWebSocketProtocols => _secWebSocketProtocols;
-
- public override string SecWebSocketVersion => _secWebSocketVersion;
-
- public override string SecWebSocketKey => _secWebSocketKey;
-
- public override CookieCollection CookieCollection => _cookieCollection;
-
- public override IPrincipal User => _user;
-
- public override bool IsAuthenticated => _isAuthenticated;
-
- public override bool IsLocal => _isLocal;
-
- public override bool IsSecureConnection => _isSecureConnection;
-
- public override WebSocket WebSocket => _webSocket;
-
- private static IPrincipal CopyPrincipal(IPrincipal user)
- {
- if (user != null)
- {
- throw new NotImplementedException();
- }
-
- return null;
- }
- }
-}