WebSocket constructor
Implementation
WebSocket({required this.peerId, required this.roomId, required this.url}) {
_protoo = ProtooClient.Peer(
ProtooClient.Transport(
'$url/?roomId=$roomId&peerId=$peerId',
),
);
_protoo.on('open', () => this.onOpen?.call());
_protoo.on('failed', () => this.onFail?.call());
_protoo.on('disconnected', () => this.onClose?.call());
_protoo.on('close', () => this.onClose?.call());
_protoo.on('request', (request, accept, reject) => this.onRequest?.call(request, accept, reject));
_protoo.on('notification', (request, accept, reject) => onNotification?.call(request));
}