Provides JsSIP.Socket interface for Node.js using the WebSocket-Node (websocket) module. Version 3.0.0 requires jssip >=3.0.0. It enables SIP over WebSocket in Node.js environments where the browser-native WebSocket is unavailable. Compared to alternatives like reconnection or raw WebSocket usage, this package conforms to JsSIP's Socket interface, simplifying integration with JsSIP UA. The package wraps the W3CWebSocket class from WebSocket-Node, supporting custom origin, headers, request options, and TLS configuration. It is maintained by the JsSIP core team and follows a stable release cadence with minimal breaking changes between major versions.
npm install jssip-node-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a NodeWebSocket instance with TLS options and use it to initialize a JsSIP user agent.
Update jssip to ^3.0.0 and jssip-node-websocket to ^3.0.0 in package.json.
Ensure Node.js >=4.0.0 as per engine requirement. For Node.js >=12, websocket 1.0.34+ works.
Avoid rejectUnauthorized: false in production; set proper ca option or use environment variable NODE_TLS_REJECT_UNAUTHORIZED=0 only for testing.
Listen to socket events (e.g., 'connect', 'disconnect') to handle errors and retry logic.
Run `npm install jssip-node-websocket` and ensure it's listed in package.json.
Use `import NodeWebSocket from 'jssip-node-websocket'` (default import) instead of `import { NodeWebSocket } from 'jssip-node-websocket'`.Run `npm install jssip@^3.0.0`.