How to use parseuri - 1 common examples

To help you get started, we’ve selected a few parseuri examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github weapp-socketio / wxapp-socket-io / src / engine.js View on Github external
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()
}

parseuri

Mighty but tiny URI parser

MIT
Latest version published 7 months ago

Package Health Score

73 / 100
Full package analysis

Popular parseuri functions