node-upnp-subscription
Advanced tools
Comparing version 1.0.5 to 1.0.6
24
index.js
"use strict"; | ||
let http = require('http'); | ||
let portfinder = require('portfinder'); | ||
let ip = require('ip'); | ||
let util = require('util'); | ||
let events = require('events'); | ||
let xmlResponseParser = require('parsexmlresponse'); | ||
const http = require('http'); | ||
const portfinder = require('portfinder'); | ||
const ip = require('ip'); | ||
const util = require('util'); | ||
const events = require('events'); | ||
const xmlResponseParser = require('parsexmlresponse'); | ||
let httpServerEmitter = new events(); | ||
httpServerEmitter.setMaxListeners(100); | ||
let httpServerStarting = false; | ||
@@ -20,5 +22,5 @@ let httpServerStarted = false; | ||
if (httpServerStarting) { | ||
httpServerEmitter.on('started', callback) | ||
httpServerEmitter.once('started', callback) | ||
} else { | ||
httpServerStarting = true | ||
httpServerStarting = true; | ||
portfinder.getPort(function (err, availablePort) { | ||
@@ -92,5 +94,5 @@ httpSubscriptionResponseServer = http.createServer(); | ||
subscriptions.delete(sid); | ||
}.bind(this) | ||
}.bind(this); | ||
this.init = function init () { | ||
this.init = function () { | ||
http.request({ | ||
@@ -122,3 +124,3 @@ host: host, | ||
events.EventEmitter.call(this); | ||
}.bind(this) | ||
}.bind(this); | ||
@@ -125,0 +127,0 @@ if (!httpServerStarted) { |
@@ -9,3 +9,3 @@ { | ||
"description": "Upnp subscription library for Node, handling subscription, renewal and expiry.", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"main": "index.js", | ||
@@ -17,2 +17,3 @@ "directories": {}, | ||
"mocha": "^2.3.4", | ||
"mockery": "^2.0.0", | ||
"nock": "^3.1.1" | ||
@@ -19,0 +20,0 @@ }, |
@@ -58,5 +58,3 @@ "use strict"; | ||
subscription1.on('subscribed', function(payload) { | ||
console.log('subscribed') | ||
sid1 = payload.sid; | ||
callback(null, true); | ||
@@ -67,5 +65,3 @@ }); | ||
subscription2.on('subscribed', function(payload) { | ||
console.log('subscribed') | ||
sid2 = payload.sid; | ||
callback(null, true); | ||
@@ -72,0 +68,0 @@ }); |
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
25468
22
506
5