@meecode/jssip-node-websocket
v4.0.2
Published
JsSIP.Socket interface for the Node.js based on the websocket module
Downloads
12
Readme
@meecode/jssip-node-websocket based on `jssip-node-websocket
jssip-node-websocket
library based on Iñaki Baz Castillo (@ibc at Github) repository with support for node versions >= 20.0.0
JsSIP.Socket
interface for Node.js based on the websocket module.
The aim of this module is to provide JsSIP with WebSocket support when running in Node.js.
Installation
$ npm install @meecode/jssip-node-websocket --save
Requirements
- jssip >=
v2.0.0
- Node.js >=
v20.0.0
Usage
const JsSIP = require('jssip');
const NodeWebSocket = require('jssip-node-websocket');
let socket = new NodeWebSocket('wss://foo.example.com');
let ua = new JsSIP.UA(
{
uri : 'sip:[email protected]',
password : 'xxxxxxxx',
display_name : 'Alice',
sockets : [ socket ]
});
API
The module exports a NodeWebSocket
class conforming with the JsSIP.Socket
interface.
var socket = new NodeWebSocket(url, [options])
url
(String): The WebSocket URL.options
(Object): An object with fieldsorigin
,headers
,requestOptions
andclientConfig
matching the same meaning and format of the parameters given to the websocket.W3CWebSocket class constructor.
F.A.Q.
How to allow invalid TLS certificates?
var socket = new Socket('wss://foo.example.com',
{
origin : 'https://www.example.com',
requestOptions :
{
agent : new https.Agent({ rejectUnauthorized: false })
}
});
Author
Iñaki Baz Castillo (@ibc at Github)