Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​AspNetCore.​Http.​WebSocketAcceptContext
Assembly: Microsoft.AspNetCore.Http.Features
Inheritance: object → WebSocketAcceptContext
A context for negotiating a websocket upgrade.
Properties
public
string
SubProtocol
Gets or sets the subprotocol being negotiated.
public
System.​TimeSpan?
KeepAliveInterval
The interval to send keep-alive frames. This is a heart-beat that keeps the connection alive.
Remarks May be either a Ping or a Pong frame, depending on if <see cref="P:Microsoft.AspNetCore.Http.WebSocketAcceptContext.KeepAliveTimeout" /> is set.
public
System.​TimeSpan?
KeepAliveTimeout
The time to wait for a Pong frame response after sending a Ping frame. If the time is exceeded the websocket will be aborted.
Remarks <c>null</c> means use the value from <c>WebSocketOptions.KeepAliveTimeout</c> .
<see cref="F:System.Threading.Timeout.InfiniteTimeSpan" /> and <see cref="F:System.TimeSpan.Zero" /> are valid values and will disable the timeout.
public
bool
DangerousEnableCompression
Enables support for the 'permessage-deflate' WebSocket extension. <para />
Be aware that enabling compression over encrypted connections makes the application subject to CRIME/BREACH type attacks.
It is strongly advised to turn off compression when sending data containing secrets by
specifying <see cref="F:System.Net.WebSockets.WebSocketMessageFlags.DisableCompression" /> when sending such messages.
public
bool
DisableServerContextTakeover
Disables server context takeover when using compression.
This setting reduces the memory overhead of compression at the cost of a potentially worse compression ratio.
Remarks This property does nothing when <see cref="P:Microsoft.AspNetCore.Http.WebSocketAcceptContext.DangerousEnableCompression" /> is false,
or when the client does not use compression.
public
int
ServerMaxWindowBits
Sets the maximum base-2 logarithm of the LZ77 sliding window size that can be used for compression.
This setting reduces the memory overhead of compression at the cost of a potentially worse compression ratio.
Remarks This property does nothing when <see cref="P:Microsoft.AspNetCore.Http.WebSocketAcceptContext.DangerousEnableCompression" /> is false,
or when the client does not use compression.
Valid values are 9 through 15.
Methods
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object