engine.io
Advanced tools
Comparing version 1.1.1 to 1.2.0
1.2.0 / 2014-05-18 | ||
================== | ||
* removed flashsocket, moving to userland | ||
1.1.1 / 2014-05-14 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -145,12 +145,3 @@ /** | ||
// flash policy file | ||
var trns = engine.transports; | ||
var policy = options.policyFile; | ||
if (~trns.indexOf('flashsocket') && false !== policy) { | ||
server.on('connection', function (socket) { | ||
engine.handleSocket(socket); | ||
}); | ||
} | ||
return engine; | ||
}; |
@@ -317,24 +317,1 @@ | ||
}; | ||
/** | ||
* Handles a regular connection to watch for flash policy requests. | ||
* | ||
* @param {net.Stream} socket | ||
* @api private | ||
*/ | ||
var policy = readFileSync(__dirname + '/transports/flashsocket.xml'); | ||
Server.prototype.handleSocket = function(socket){ | ||
socket.on('data', function onData(data){ | ||
// no need for buffering as node will discard subsequent packets | ||
// since they constitute a malformed HTTP request | ||
if (60 == data[0] && 23 == data.length) { | ||
var str = data.slice(0, 23).toString(); | ||
if ('<policy-file-request/>\0' == str) { | ||
socket.end(policy); | ||
} | ||
} | ||
socket.removeListener('data', onData); | ||
}); | ||
}; |
@@ -6,4 +6,4 @@ | ||
var XHR = require('./polling-xhr') | ||
, JSONP = require('./polling-jsonp') | ||
var XHR = require('./polling-xhr'); | ||
var JSONP = require('./polling-jsonp'); | ||
@@ -15,5 +15,4 @@ /** | ||
module.exports = exports = { | ||
polling: polling | ||
, websocket: require('./websocket') | ||
, flashsocket: require('./flashsocket') | ||
polling: polling, | ||
websocket: require('./websocket') | ||
}; | ||
@@ -25,3 +24,3 @@ | ||
exports.polling.upgradesTo = ['websocket', 'flashsocket']; | ||
exports.polling.upgradesTo = ['websocket']; | ||
@@ -28,0 +27,0 @@ /** |
{ | ||
"name": "engine.io", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", | ||
@@ -28,3 +28,3 @@ "main": "./lib/engine.io", | ||
"superagent": "0.15.4", | ||
"engine.io-client": "1.1.1", | ||
"engine.io-client": "1.2.0", | ||
"s": "0.1.1" | ||
@@ -31,0 +31,0 @@ }, |
@@ -7,7 +7,7 @@ | ||
`Engine` is the implementation of transport-based cross-browser/cross-device | ||
bi-directional communication layer for | ||
`Engine.IO` is the implementation of transport-based | ||
cross-browser/cross-device bi-directional communication layer for | ||
[Socket.IO](http://github.com/learnboost/socket.io). | ||
## Hello World | ||
## How to use | ||
@@ -139,3 +139,2 @@ ### Server | ||
- `path` (`String`): name of the path to capture (`/engine.io`). | ||
- `policyFile` (`Boolean`): whether to handle policy file requests (`true`) | ||
- `destroyUpgrade` (`Boolean`): destroy unhandled upgrade requests (`true`) | ||
@@ -189,3 +188,3 @@ - `destroyUpgradeTimeout` (`Number`): milliseconds after which unhandled requests are ended (`1000`) | ||
- `transports` (`<Array> String`): transports to allow connections | ||
to (`['polling', 'websocket', 'flashsocket']`) | ||
to (`['polling', 'websocket']`) | ||
- `allowUpgrades` (`Boolean`): whether to allow transport upgrades | ||
@@ -212,8 +211,2 @@ (`true`) | ||
- **Returns** `Server` for chaining | ||
- `handleSocket` | ||
- Called with raw TCP sockets from http requests to intercept flash policy | ||
file requests | ||
- **Parameters** | ||
- `net.Stream`: TCP socket on which requests are listened | ||
- **Returns** `Server` for chaining | ||
@@ -306,3 +299,2 @@ <hr><br> | ||
- `websocket`: WebSocket transport. | ||
- `flashsocket`: WebSocket transport backed by flash. | ||
@@ -359,3 +351,3 @@ ## Plugins | ||
WebSocket/FlashSocket based connections have two fundamental benefits: | ||
WebSocket based connections have two fundamental benefits: | ||
@@ -362,0 +354,0 @@ 1. **Better server performance** |
59847
17
1306
482