constructor(url)
Description
Creates a new socket instance and stores the WebSocket URL. The instance will lazily open the
connection when connect() is called, and it keeps an internal
reference to the underlying WebSocket object.
Parameters
- url – WebSocket server URL (e.g.
"wss://example.com/ws").
Signature
constructor(url: string)
Example
import { Socket } from "@ckn-technology/core";
const socket = new Socket("wss://example.com/ws");