Repository F# setup
open System
open System.IO
open System.Threading
open System.Threading.Tasks
open Axial
open Axial.Console
open Axial.FileSystem
open Axial.Hosting
open Axial.Hosting.Browser
open Axial.Hosting.Node
open Axial.State
open Axial.Telemetry
open Axial.Telemetry.JavaScript
open Axial.WebSocket

WebSocket

Axial.WebSocket wraps ClientWebSocket as an explicit service with typed messages and errors. Install it and open Axial.WebSocket:

dotnet add package Axial.WebSocket
Verified
open Axial.WebSocket

WebSocket.connect creates connection options, WebSocket.openSession obtains a session from IHasWebSocket, and WebSocket.withConnection disposes it when the scope ends. TestWebSocket supplies a scripted transport for tests.

Guides

  1. WebSocket sessions: connect, send and receive typed messages, handle errors, and test without a live server.

Reference

The generated WebSocket API lists connection, session, message, and error types.