Comparing version 2.4.6 to 2.4.7
@@ -83,3 +83,7 @@ 'use strict'; | ||
this.server = server; | ||
this.pathname = options.pathname || '/primus'; | ||
this.pathname = 'string' === typeof options.pathname | ||
? options.pathname.charAt(0) !== '/' | ||
? '/'+ options.pathname | ||
: options.pathname | ||
: '/primus'; | ||
@@ -86,0 +90,0 @@ // |
{ | ||
"name": "primus", | ||
"version": "2.4.6", | ||
"version": "2.4.7", | ||
"description": "Primus is a simple abstraction around real-time frameworks. It allows you to easily switch between different frameworks without any code changes.", | ||
@@ -72,3 +72,3 @@ "main": "index.js", | ||
"pre-commit": "0.0.x", | ||
"request": "2.42.x", | ||
"request": "2.44.x", | ||
"socket.io": "0.9.x", | ||
@@ -75,0 +75,0 @@ "socket.io-client": "0.9.x", |
@@ -952,3 +952,3 @@ /*globals require, define */ | ||
this.write('primus::id::'); | ||
this._write('primus::id::'); | ||
return this.once('incoming::id', fn); | ||
@@ -1073,3 +1073,3 @@ }; | ||
primus.clearTimeout('ping').write('primus::ping::'+ value); | ||
primus.clearTimeout('ping')._write('primus::ping::'+ value); | ||
primus.emit('outgoing::ping', value); | ||
@@ -1076,0 +1076,0 @@ primus.timers.pong = setTimeout(pong, primus.options.pong); |
'use strict'; | ||
var path = require('path') | ||
, directory = path.dirname(require.resolve('socket.io')) | ||
, library = path.join(directory, 'node_modules/socket.io-client/dist/socket.io.js'); | ||
// | ||
// Testing edge-case. We're also installing the socket.io-client and npm tries | ||
// to be a smarty pants and optimize our packages and removes the | ||
// socket.io-client from the dependencies directory as it's already in the | ||
// parents `node_module`. | ||
// | ||
try { | ||
directory = path.dirname(require.resolve('socket.io-client')); | ||
library = path.join(directory, '../dist/socket.io.js'); | ||
} catch (e) {} | ||
// | ||
// Expose the module as new Transformer instance. | ||
@@ -29,3 +14,3 @@ // | ||
// The client-side library of socket.io. | ||
library: require('fs').readFileSync(library, 'utf-8') | ||
library: require('fs').readFileSync(__dirname + '/library.js', 'utf-8') | ||
}); |
493389
60
12617