A NetworkAdapter which connects to a remote host via WebSockets
The websocket protocol requires a server to be listening and a client to
connect to the server. To that end the WebSocketServerAdapter does not
make outbound connections and instead listens on the provided socket for
new connections whilst the WebSocketClientAdapter makes an
outbound connection to the provided socket.
Note that the "browser" and "node" naming is historical: the client adapter
uses the platform-native WebSocket (browser and Node alike), while the server
adapter wraps a ws WebSocketServer (Node only).
A
NetworkAdapterwhich connects to a remote host via WebSocketsThe websocket protocol requires a server to be listening and a client to connect to the server. To that end the WebSocketServerAdapter does not make outbound connections and instead listens on the provided socket for new connections whilst the WebSocketClientAdapter makes an outbound connection to the provided socket.
Note that the "browser" and "node" naming is historical: the client adapter uses the platform-native WebSocket (browser and Node alike), while the server adapter wraps a
wsWebSocketServer (Node only).