UpgradeResponse

The HTTP Upgrade to WebSocket Response

Members

Functions

addHeader
void addHeader(string name, string value)

Add a header value to the response.

getAcceptedSubProtocol
string getAcceptedSubProtocol()

Get the accepted WebSocket protocol.

getExtensions
List!(ExtensionConfig) getExtensions()

Get the list of extensions that should be used for the websocket.

getHeader
string getHeader(string name)

Get a header value

getHeaderNames
Set!(string) getHeaderNames()

Get the header names

getHeaders
Map!(string, List!(string)) getHeaders()

Get the headers map

getHeaders
List!(string) getHeaders(string name)

Get the multi-value header value

getStatusCode
int getStatusCode()

Get the HTTP Response Status Code

getStatusReason
string getStatusReason()

Get the HTTP Response Status Reason

isSuccess
bool isSuccess()

Test if upgrade response is successful. !(p) Merely notes if the response was sent as a WebSocket Upgrade, or was failed (resulting in no upgrade handshake)

sendForbidden
void sendForbidden(string message)

Issue a forbidden upgrade response. !(p) This means that the websocket endpoint was valid, but the conditions to use a WebSocket resulted in a forbidden access. !(p) Use this when the origin or authentication is invalid.

setAcceptedSubProtocol
void setAcceptedSubProtocol(string protocol)

Set the accepted WebSocket Protocol.

setExtensions
void setExtensions(List!(ExtensionConfig) extensions)

Set the list of extensions that are approved for use with this websocket. !(p) Notes: !(ul) !(li)Per the spec you cannot add extensions that have not been seen in the {@link UpgradeRequest}, just remove entries you don't want to use!(/li) !(li)If this is unused, or a null is passed, then the list negotiation will follow default behavior and use the complete list of extensions that are available in this WebSocket server implementation.!(/li) !(/ul)

setHeader
void setHeader(string name, string value)

Set a header !(p) Overrides previous value of header (if set)

setStatusCode
void setStatusCode(int statusCode)

Set the HTTP Response status code

setStatusReason
void setStatusReason(string statusReason)

Set the HTTP Response status reason phrase !(p) Note, not all implementation of UpgradeResponse can support this feature

setSuccess
void setSuccess(bool success)

Set the success of the upgrade response. !(p)

Meta