By default, KOS does not allow any incoming network connections. For applications that require inbound events, the preferred pattern is to first establish an outbound websocket connection, and then receive events over that websocket. To facilitate the use of websockets, KOS provides two websocket clients.
The first client is SimpleWebsocketClient. This is a typical, configure-and-connect client that is useful for transactional websocket applications.
The second client is WebsocketClient which once configured will continually try to connect to the specified target. This client generates lifecycle callbacks for connect and disconnect events, and supports exponential back-off on connection retries. For applications that desire an always-open websocket, this is the client to use as it requires no manual intervention once configured.