Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Engine(uri, opts) {
if (!(this instanceof Engine)) return new Engine(uri, opts)
this.subs = []
uri = parseuri(uri)
this.protocol = uri.protocol
this.host = uri.host
this.query = uri.query
this.port = uri.port
this.opts = this.opts || {}
this.path = opts.path.replace(/\/$/, '')
this.connected = false
this.lastPing = null
this.pingInterval = 20000
// init bind with GlobalEmitter
this.bindEvents()
}