Compare commits

...

9 Commits
1 ... 0.9.0

Author SHA1 Message Date
Guillermo Rauch
204576c006 Make these 2 tests work both on 0.4 and 0.6 2012-02-26 21:51:22 -03:00
Guillermo Rauch
66ac425bf7 Release 0.9.0 2012-02-26 21:46:39 -03:00
Guillermo Rauch
a01e7e2256 Make tests pass on 0.4 2012-02-26 18:21:25 -03:00
Guillermo Rauch
47cfa5aadf Fixed tests. All 250 passing. 2012-02-26 17:14:06 -03:00
Guillermo Rauch
ddd7f804af Fixed cross-domain xhr tests. 2012-02-26 17:11:52 -03:00
Guillermo Rauch
8c1c7a24ef Merge pull request #744 from ajaxorg/regexp-as-resource
make it possible to use a regexp to match the socket.io resource URL
2012-02-09 09:38:03 -08:00
Fabian Jakobs
09b130f4cf 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.
2012-02-09 17:17:55 +01:00
Guillermo Rauch
b662704b0b Merge pull request #737 from mixu/mixu/authfix2
Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports
2012-02-03 14:24:57 -08:00
Mikito Takada
304a4285ff Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports 2012-02-03 12:20:40 -08:00
18 changed files with 66 additions and 32 deletions

View File

@@ -1,4 +1,35 @@
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
==================

View File

@@ -904,8 +904,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);

View File

@@ -15,7 +15,7 @@ var client = require('socket.io-client');
* Version.
*/
exports.version = '0.8.7';
exports.version = '0.9.0';
/**
* Supported protocol version.

View File

@@ -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;

View File

@@ -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);

View File

@@ -1,6 +1,6 @@
{
"name": "socket.io"
, "version": "0.8.7"
, "version": "0.9.0"
, "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.0"
, "policyfile": "0.0.4"
, "redis": "0.6.7"
}

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var io = require('socket.io')
var io = require('../')
, parser = io.parser
, http = require('http')
, https = require('https')

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, fs = require('fs')
, http = require('http')
, https = require('https')

View File

@@ -8,7 +8,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, http = require('http')
, should = require('./common')
, ports = 15100;

View File

@@ -3,7 +3,7 @@
* Test dependencies.
*/
var parser = require('socket.io').parser
var parser = require('../').parser
, decode = parser.decode
, should = require('./common');

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, should = require('./common')
, ports = 15400;

View File

@@ -5,7 +5,7 @@
* @api private
*/
var sio = require('socket.io')
var sio = require('../')
, should = require('should')
, MemoryStore = sio.MemoryStore;

View File

@@ -5,7 +5,7 @@
* @api private
*/
var sio = require('socket.io')
var sio = require('../')
, redis = require('redis')
, should = require('should')
, RedisStore = sio.RedisStore;

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, net = require('net')
, http = require('http')
, should = require('./common')

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, should = require('./common')
, HTTPClient = should.HTTPClient
, parser = sio.parser

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, should = require('./common')
, qs = require('querystring')
, HTTPClient = should.HTTPClient

View File

@@ -9,7 +9,7 @@
* Test dependencies.
*/
var sio = require('socket.io')
var sio = require('../')
, should = require('./common')
, parser = sio.parser
, ports = 15800;
@@ -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;

View File

@@ -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');