mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 07:58:13 -05:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7d7582f84 | ||
|
|
df5f23d309 | ||
|
|
e018ba91eb | ||
|
|
c59aa6ff2c | ||
|
|
9431709298 | ||
|
|
a29525e043 | ||
|
|
5312e154b3 | ||
|
|
480b86f382 | ||
|
|
c0e2c3012f | ||
|
|
97b04c4152 | ||
|
|
c8306e207d | ||
|
|
de5c0b3554 | ||
|
|
57a0b24060 | ||
|
|
204576c006 | ||
|
|
66ac425bf7 | ||
|
|
a01e7e2256 | ||
|
|
47cfa5aadf | ||
|
|
ddd7f804af | ||
|
|
8c1c7a24ef | ||
|
|
09b130f4cf | ||
|
|
b662704b0b | ||
|
|
304a4285ff |
@@ -1,6 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.4
|
||||
- 0.6
|
||||
|
||||
notifications:
|
||||
|
||||
48
History.md
48
History.md
@@ -1,4 +1,52 @@
|
||||
|
||||
0.9.2 / 2012-03-13
|
||||
==================
|
||||
|
||||
* More sensible close `timeout default` (fixes disconnect issue)
|
||||
|
||||
0.9.1-1 / 2012-03-02
|
||||
====================
|
||||
|
||||
* Bumped client with NPM dependency fix.
|
||||
|
||||
0.9.1 / 2012-03-02
|
||||
==================
|
||||
|
||||
* Changed heartbeat timeout and interval defaults (60 and 25 seconds)
|
||||
* Make tests work both on 0.4 and 0.6
|
||||
* Updated client (improvements + bug fixes).
|
||||
|
||||
0.9.0 / 2012-02-26
|
||||
==================
|
||||
|
||||
* Make it possible to use a regexp to match the socket.io resource URL.
|
||||
We need this because we have to prefix the socket.io URL with a variable ID.
|
||||
* Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports
|
||||
* Updated express dep for windows compatibility.
|
||||
* Combine two substr calls into one in decodePayload to improve performance
|
||||
* Minor documentation fix
|
||||
* Minor. Conform to style of other files.
|
||||
* Switching setting to 'match origin protocol'
|
||||
* Revert "Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect()."
|
||||
* Revert "Handle leaked dispatch:[id] subscription."
|
||||
* Merge pull request #667 from dshaw/patch/redis-disconnect
|
||||
* Handle leaked dispatch:[id] subscription.
|
||||
* Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect().
|
||||
* Prevent memory leaking on uncompleted requests & add max post size limitation
|
||||
* Fix for testcase
|
||||
* Set Access-Control-Allow-Credentials true, regardless of cookie
|
||||
* Remove assertvarnish from package as it breaks on 0.6
|
||||
* Correct irc channel
|
||||
* Added proper return after reserved field error
|
||||
* Fixes manager.js failure to close connection after transport error has happened
|
||||
* Added implicit port 80 for origin checks. fixes #638
|
||||
* Fixed bug #432 in 0.8.7
|
||||
* Set Access-Control-Allow-Origin header to origin to enable withCredentials
|
||||
* Adding configuration variable matchOriginProtocol
|
||||
* Fixes location mismatch error in Safari.
|
||||
* Use tty to detect if we should add colors or not by default.
|
||||
* Updated the package location.
|
||||
|
||||
0.8.7 / 2011-11-05
|
||||
==================
|
||||
|
||||
|
||||
@@ -71,9 +71,9 @@ function Manager (server, options) {
|
||||
, blacklist: ['disconnect']
|
||||
, 'log level': 3
|
||||
, 'log colors': tty.isatty(process.stdout.fd)
|
||||
, 'close timeout': 25
|
||||
, 'heartbeat timeout': 15
|
||||
, 'heartbeat interval': 20
|
||||
, 'close timeout': 60
|
||||
, 'heartbeat interval': 25
|
||||
, 'heartbeat timeout': 60
|
||||
, 'polling duration': 20
|
||||
, 'flash policy server': true
|
||||
, 'flash policy port': 10843
|
||||
@@ -133,6 +133,12 @@ function Manager (server, options) {
|
||||
}
|
||||
}
|
||||
|
||||
// forward-compatibility with 1.0
|
||||
var self = this;
|
||||
this.sockets.on('connection', function (conn) {
|
||||
self.emit('connection', conn);
|
||||
});
|
||||
|
||||
this.log.info('socket.io started');
|
||||
};
|
||||
|
||||
@@ -252,7 +258,7 @@ Manager.prototype.disabled = function (key) {
|
||||
Manager.prototype.configure = function (env, fn) {
|
||||
if ('function' == typeof env) {
|
||||
env.call(this);
|
||||
} else if (env == process.env.NODE_ENV) {
|
||||
} else if (env == (process.env.NODE_ENV || 'development')) {
|
||||
fn.call(this);
|
||||
}
|
||||
|
||||
@@ -904,8 +910,17 @@ var regexp = /^\/([^\/]+)\/?([^\/]+)?\/?([^\/]+)?\/?$/
|
||||
Manager.prototype.checkRequest = function (req) {
|
||||
var resource = this.get('resource');
|
||||
|
||||
if (req.url.substr(0, resource.length) == resource) {
|
||||
var uri = url.parse(req.url.substr(resource.length), true)
|
||||
var match;
|
||||
if (typeof resource === 'string') {
|
||||
match = req.url.substr(0, resource.length);
|
||||
if (match !== resource) match = null;
|
||||
} else {
|
||||
match = resource.exec(req.url);
|
||||
if (match) match = match[0];
|
||||
}
|
||||
|
||||
if (match) {
|
||||
var uri = url.parse(req.url.substr(match.length), true)
|
||||
, path = uri.pathname || ''
|
||||
, pieces = path.match(regexp);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ var client = require('socket.io-client');
|
||||
* Version.
|
||||
*/
|
||||
|
||||
exports.version = '0.8.7';
|
||||
exports.version = '0.9.2';
|
||||
|
||||
/**
|
||||
* Supported protocol version.
|
||||
|
||||
@@ -72,11 +72,8 @@ HTTPTransport.prototype.handleRequest = function (req) {
|
||||
|
||||
if (origin) {
|
||||
// https://developer.mozilla.org/En/HTTP_Access_Control
|
||||
headers['Access-Control-Allow-Origin'] = '*';
|
||||
|
||||
if (req.headers.cookie) {
|
||||
headers['Access-Control-Allow-Credentials'] = 'true';
|
||||
}
|
||||
headers['Access-Control-Allow-Origin'] = origin;
|
||||
headers['Access-Control-Allow-Credentials'] = 'true';
|
||||
}
|
||||
} else {
|
||||
this.response = req.res;
|
||||
|
||||
@@ -59,11 +59,8 @@ XHRPolling.prototype.doWrite = function (data) {
|
||||
|
||||
if (origin) {
|
||||
// https://developer.mozilla.org/En/HTTP_Access_Control
|
||||
headers['Access-Control-Allow-Origin'] = '*';
|
||||
|
||||
if (this.req.headers.cookie) {
|
||||
headers['Access-Control-Allow-Credentials'] = 'true';
|
||||
}
|
||||
headers['Access-Control-Allow-Origin'] = origin;
|
||||
headers['Access-Control-Allow-Credentials'] = 'true';
|
||||
}
|
||||
|
||||
this.response.writeHead(200, headers);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "socket.io"
|
||||
, "version": "0.8.7"
|
||||
, "version": "0.9.2"
|
||||
, "description": "Real-time apps made cross-browser & easy with a WebSocket-like API"
|
||||
, "homepage": "http://socket.io"
|
||||
, "keywords": ["websocket", "socket", "realtime", "socket.io", "comet", "ajax"]
|
||||
@@ -16,7 +16,7 @@
|
||||
, "url": "https://github.com/LearnBoost/socket.io.git"
|
||||
}
|
||||
, "dependencies": {
|
||||
"socket.io-client": "0.8.7"
|
||||
"socket.io-client": "0.9.2"
|
||||
, "policyfile": "0.0.4"
|
||||
, "redis": "0.6.7"
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var io = require('socket.io')
|
||||
var io = require('../')
|
||||
, parser = io.parser
|
||||
, http = require('http')
|
||||
, https = require('https')
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, fs = require('fs')
|
||||
, http = require('http')
|
||||
, https = require('https')
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, http = require('http')
|
||||
, should = require('./common')
|
||||
, ports = 15100;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var parser = require('socket.io').parser
|
||||
var parser = require('../').parser
|
||||
, decode = parser.decode
|
||||
, should = require('./common');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, should = require('./common')
|
||||
, ports = 15400;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @api private
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, should = require('should')
|
||||
, MemoryStore = sio.MemoryStore;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @api private
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, redis = require('redis')
|
||||
, should = require('should')
|
||||
, RedisStore = sio.RedisStore;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, net = require('net')
|
||||
, http = require('http')
|
||||
, should = require('./common')
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, should = require('./common')
|
||||
, HTTPClient = should.HTTPClient
|
||||
, parser = sio.parser
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, should = require('./common')
|
||||
, qs = require('querystring')
|
||||
, HTTPClient = should.HTTPClient
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, should = require('./common')
|
||||
, parser = sio.parser
|
||||
, ports = 15800;
|
||||
@@ -25,7 +25,7 @@ module.exports = {
|
||||
, ws;
|
||||
|
||||
io.set('transports', ['websocket']);
|
||||
io.sockets.on('connection', function (socket) {
|
||||
io.on('connection', function (socket) {
|
||||
socket.manager.transports[socket.id].name.should.equal('websocket');
|
||||
ws.finishClose();
|
||||
cl.end();
|
||||
@@ -131,7 +131,7 @@ module.exports = {
|
||||
var url = '/socket.io/' + sio.protocol + '/websocket/' + sid;
|
||||
var req = cl.get(url, {headers: headers}, function (res, data) {});
|
||||
var closed = false;
|
||||
req.on('close', function() {
|
||||
(req.socket || req).on('close', function() {
|
||||
if (closed) return;
|
||||
closed = true;
|
||||
notConnected.should.be.true;
|
||||
@@ -169,7 +169,7 @@ module.exports = {
|
||||
var url = '/socket.io/' + sio.protocol + '/websocket/' + sid;
|
||||
var req = cl.get(url, {headers: headers}, function (res, data) {});
|
||||
var closed = false;
|
||||
req.on('close', function() {
|
||||
(req.socket || req).on('close', function() {
|
||||
if (closed) return;
|
||||
closed = true;
|
||||
notConnected.should.be.true;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* Test dependencies.
|
||||
*/
|
||||
|
||||
var sio = require('socket.io')
|
||||
var sio = require('../')
|
||||
, should = require('./common')
|
||||
, HTTPClient = should.HTTPClient
|
||||
, parser = sio.parser
|
||||
@@ -2652,8 +2652,8 @@ module.exports = {
|
||||
}, function (res, packs) {
|
||||
var headers = res.headers;
|
||||
|
||||
headers['access-control-allow-origin'].should.equal('*');
|
||||
should.strictEqual(headers['access-control-allow-credentials'], undefined);
|
||||
headers['access-control-allow-origin'].should.equal('http://localhost:3500');
|
||||
headers['access-control-allow-credentials'].should.equal('true');
|
||||
|
||||
packs.should.have.length(1);
|
||||
packs[0].type.should.eql('message');
|
||||
@@ -2669,7 +2669,7 @@ module.exports = {
|
||||
}
|
||||
}, function (res, data) {
|
||||
var headers = res.headers;
|
||||
headers['access-control-allow-origin'].should.equal('*');
|
||||
headers['access-control-allow-origin'].should.equal('http://localhost:3500');
|
||||
headers['access-control-allow-credentials'].should.equal('true');
|
||||
|
||||
data.should.equal('1');
|
||||
|
||||
Reference in New Issue
Block a user