# WebSocketSharp.Net.WebSockets.WebSocketContext

websocket-sharp : WebSocketSharp.Net.WebSockets Namespace

# WebSocketContext Class

Provides access to the WebSocket connection request objects.

## Syntax

public abstract class WebSocketContext

## Remarks

The WebSocketContext class is an abstract class.

## Requirements

Namespace: WebSocketSharp.Net.WebSockets
Assembly: websocket-sharp (in websocket-sharp.dll)

## Members

See Also: Inherited members from object.

## Protected Constructors

| WebSocketContext () | Initializes a new instance of the WebSocketSharp.Net.WebSockets.WebSocketContext class.

## Public Properties

[read-only] abstract | CookieCollection | WebSocketSharp.Net.CookieCollection . Gets the cookies used in the WebSocket opening handshake.
[read-only] abstract | Headers | System.Collections.Specialized.NameValueCollection . Gets the HTTP headers used in the WebSocket opening handshake.
[read-only] abstract | IsAuthenticated | bool . Gets a value indicating whether the client is authenticated.
[read-only] abstract | IsLocal | bool . Gets a value indicating whether the client connected from the local computer.
[read-only] abstract | IsSecureConnection | bool . Gets a value indicating whether the WebSocket connection is secured.
[read-only] abstract | Origin | string . Gets the value of the Origin header field used in the WebSocket opening handshake.
[read-only] abstract | RequestUri | Uri . Gets the WebSocket URI requested by the client.
[read-only] abstract | SecWebSocketKey | string . Gets the value of the Sec-WebSocket-Key header field used in the WebSocket opening handshake.
[read-only] abstract | SecWebSocketProtocols | IEnumerable<string> . Gets the values of the Sec-WebSocket-Protocol header field used in the WebSocket opening handshake.
[read-only] abstract | SecWebSocketVersion | string . Gets the value of the Sec-WebSocket-Version header field used in the WebSocket opening handshake.
[read-only] abstract | User | System.Security.Principal.IPrincipal . Gets the client information (identity, authentication information and security roles).
[read-only] abstract | WebSocket | WebSocketSharp.WebSocket . Gets the WebSocket instance used for two-way communication between client and server.

## Extension Methods

static

IsNull<T> (this T) : bool

> Determines whether the specified object is `null`.

static

IsNullDo<T> (this T, Action) : bool

> Determines whether the specified object is `null`. And invokes the specified Action delegate if the specified object is `null`.

## Member Details

### WebSocketContext Constructor

> Initializes a new instance of the WebSocketSharp.Net.WebSockets.WebSocketContext class.

> ## Syntax

> protected WebSocketContext ()

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### CookieCollection Property

> Gets the cookies used in the WebSocket opening handshake.

> ## Syntax

> public abstract WebSocketSharp.Net.CookieCollection CookieCollection { get; }

> #### Value

> > A WebSocketSharp.Net.CookieCollection that contains the cookies.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### Headers Property

> Gets the HTTP headers used in the WebSocket opening handshake.

> ## Syntax

> public abstract System.Collections.Specialized.NameValueCollection Headers { get; }

> #### Value

> > A System.Collections.Specialized.NameValueCollection that contains the HTTP headers.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsAuthenticated Property

> Gets a value indicating whether the client is authenticated.

> ## Syntax

> public abstract bool IsAuthenticated { get; }

> #### Value

> > `true` if the client is authenticated; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsLocal Property

> Gets a value indicating whether the client connected from the local computer.

> ## Syntax

> public abstract bool IsLocal { get; }

> #### Value

> > `true` if the client connected from the local computer; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### IsSecureConnection Property

> Gets a value indicating whether the WebSocket connection is secured.

> ## Syntax

> public abstract bool IsSecureConnection { get; }

> #### Value

> > `true` if the WebSocket connection is secured; otherwise, `false`.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### Origin Property

> Gets the value of the Origin header field used in the WebSocket opening handshake.

> ## Syntax

> public abstract string Origin { get; }

> #### Value

> > A string that contains the value of the Origin header field.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### RequestUri Property

> Gets the WebSocket URI requested by the client.

> ## Syntax

> public abstract Uri RequestUri { get; }

> #### Value

> > A Uri that contains the WebSocket URI.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### SecWebSocketKey Property

> Gets the value of the Sec-WebSocket-Key header field used in the WebSocket opening handshake.

> ## Syntax

> public abstract string SecWebSocketKey { get; }

> #### Value

> > A string that contains the value of the Sec-WebSocket-Key header field.

> ## Remarks

> The SecWebSocketKey property provides a part of the information used by the server to prove that it received a valid WebSocket opening handshake.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### SecWebSocketProtocols Property

> Gets the values of the Sec-WebSocket-Protocol header field used in the WebSocket opening handshake.

> ## Syntax

> public abstract IEnumerable<string> SecWebSocketProtocols { get; }

> #### Value

> > An IEnumerable<string> that contains the values of the Sec-WebSocket-Protocol header field.

> ## Remarks

> The SecWebSocketProtocols property indicates the subprotocols of the WebSocket connection.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### SecWebSocketVersion Property

> Gets the value of the Sec-WebSocket-Version header field used in the WebSocket opening handshake.

> ## Syntax

> public abstract string SecWebSocketVersion { get; }

> #### Value

> > A string that contains the value of the Sec-WebSocket-Version header field.

> ## Remarks

> The SecWebSocketVersion property indicates the WebSocket protocol version of the connection.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### User Property

> Gets the client information (identity, authentication information and security roles).

> ## Syntax

> public abstract System.Security.Principal.IPrincipal User { get; }

> #### Value

> > An System.Security.Principal.IPrincipal that contains the client information.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)

### WebSocket Property

> Gets the WebSocket instance used for two-way communication between client and server.

> ## Syntax

> public abstract WebSocketSharp.WebSocket WebSocket { get; }

> #### Value

> > A WebSocketSharp.WebSocket.

> ## Remarks

> Documentation for this section has not yet been entered.

> ## Requirements

> Namespace: WebSocketSharp.Net.WebSockets
> Assembly: websocket-sharp (in websocket-sharp.dll)