airfone-client-js
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -8,3 +8,4 @@ export declare type StatusEvent = 'connect' | 'disconnect' | 'online' | 'offline' | 'error'; | ||
readonly room: String; | ||
constructor(id: String, role: String, room: String, server?: String); | ||
readonly token?: String; | ||
constructor(id: String, role: String, room: String, server?: String, token?: String); | ||
} | ||
@@ -11,0 +12,0 @@ /** |
@@ -12,3 +12,3 @@ import { io } from 'socket.io-client'; | ||
export class ClientOptions { | ||
constructor(id, role, room, server) { | ||
constructor(id, role, room, server, token) { | ||
this.id = id; | ||
@@ -18,2 +18,3 @@ this.role = role; | ||
this.server = server; | ||
this.token = token; | ||
} | ||
@@ -29,9 +30,13 @@ } | ||
connect() { | ||
let { id, room, role, server } = this.options; | ||
let { id, room, role, server, token } = this.options; | ||
this.state = 1; | ||
this.socket = io(`${win.AF_SERVER || server || '/'}`, { | ||
let opts = { | ||
query: { id, room, role }, | ||
transports: ['websocket'], | ||
secure: true | ||
}).compress(true).on('connect', () => { | ||
}; | ||
if (token) { | ||
opts.auth = { token }; | ||
} | ||
this.socket = io(`${win.AF_SERVER || server || '/'}`, opts).compress(true).on('connect', () => { | ||
var _a; | ||
@@ -38,0 +43,0 @@ this.state = 2; |
{ | ||
"name": "airfone-client-js", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7166
171