WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

Endpoint
Name:ws:response
Description:
Id:ws:response
Category:accessor
Identifier Syntax

ws:response is an accessor using a standard identifier grammar:

<grammar>
  <group>wsResponse:/
    <group name="path">
      <regex>message|disconnect</regex>
    </group>
  </group>
</grammar>

with the following arguments: (for more details on argument passing details see here)

ArgumentRulesTypingDescription
path(no description available)
Request Verbs

The following verb is supported:

Verb
SINK
Response

The response representation of this accessor for SOURCE requests is unknown.

This accessor throws no documented exceptions.

When an HTTPRequest has been upgraded to a WebSocket, the HTTPBridge inserts a dynamic space into the request scope containing a WebSocket Transport from which external WebSocket events will trigger ROC requests.

In addition the injected space also provides the SINKable WebSocket response resource-set using the wsResponse: URI scheme.

wsResponse:/message

SINK a String to this resource to send a message back to the same WebSocket

wsResponse:/disconnect

SINK a boolean true, to force the current WebSocket to close. (Note this will also trigger the WSTransport to issue a DELETE ws:/PATH+socketid@XYZ request back to you so you can clean up any state you might have for that socket)

WebSockets and httpRequest:/

An upgraded WebSocket is associated with an originating HTTPRequest. Therefore the injected dynamic space also provides access to the regular httpRequest:/ resources.

Note there is no httpResponse: when handling a WebSocket.