Class Ws

Assembly: redb.Route.WebSocket.dll

Fluent entry point for WebSocket endpoints.

// Consumer — listen for WS connections:
.From(Ws.Listen("0.0.0.0:8080/chat").SubProtocol("json").InOut())

// Producer — connect to remote WS:
.To(Ws.Connect("api.example.com:443/stream").Ssl().Binary())

// Secure WebSocket (wss):
.To(Ws.Connect("api.example.com/stream").Ssl())

public static class Ws

Inheritance

Object→Ws

Methods

Broadcast(string)

Push into the clients of the local consumer serving this address, so a route can send

public static WsBuilder Broadcast(string hostPortPath)

Connect(string)

Connect to a remote WebSocket (producer).

public static WsBuilder Connect(string hostPortPath)

Listen(string)

Listen for WebSocket connections (consumer).

public static WsBuilder Listen(string hostPortPath)