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

Method that parses a URI and returns an array of its components

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis

Popular parseuri functions