http.server -> ws

Description

The WebSockets web application specifications that the server will construct.

The configuration of each specified WebSockets web application must have a location property (of type string). The location property corresponds to the path or set of paths which will trigger the HTTP upgrade request which will subsequently be handled by the specified web application.

Simple configuration

The ws composite property does not contain any value properties.

Composite configuration

The ws composite property can contain any conforming composite property.

A conforming composite property represents a WebSockets web application, the configuration of which must contain the following simple properties.

Name Type Default value Description
location string The path or set of paths which trigger the HTTP upgrade request which will subsequently be handled by the web application.

Built-in web-apps

The following WebSocket web applications are available from the Balau library.

Name Description
echo Echos messages back to the client.
null Silently consumes data without responding.

Custom web-apps

Custom WebSocket web applications must be registered by calling the registerWsWebApp method before the application injector is created.