Compare commits

...

3 Commits

Author SHA1 Message Date
James Coglan 7fc369fc82 Bump version to 0.5.0. 2013-05-05 01:47:37 +01:00
James Coglan ec4ba0eb74 Use pipe() for the Autobahn echo client. 2013-05-05 00:01:17 +01:00
James Coglan d9475f5b07 Don't end the EventSource when piping a file into it. 2013-05-04 21:37:46 +01:00
6 changed files with 14 additions and 11 deletions
+1
View File
@@ -4,3 +4,4 @@
.redcar
.travis.yml
node_modules
spec
+6
View File
@@ -1,3 +1,9 @@
### 0.5.0 / 2013-05-05
* Extract the protocol handlers into the `websocket-driver` library
* Support the Node streaming API
### 0.4.4 / 2013-02-14
* Emit the `close` event if TCP is closed before CLOSE frame is acked
+3 -1
View File
@@ -133,7 +133,9 @@ socket objects expose the selected protocol through the `ws.protocol` property.
## WebSocket API
Both server- and client-side `WebSocket` objects support the following API:
Both server- and client-side `WebSocket` objects support the following API.
They are both readable and writable streams, so for example you can write an
echo server using `socket.pipe(socket)`.
* <b>`on('open', function(event) {})`</b> fires when the socket connection is
established. Event has no attributes.
+2 -8
View File
@@ -28,14 +28,8 @@ socket.onclose = function() {
} else {
socket = new WebSocket.Client(host + '/runCase?case=' + n + '&agent=' + encodeURIComponent(agent));
socket.onmessage = function(event) {
socket.send(event.data);
};
socket.onclose = function() {
runCase(n + 1);
};
socket.pipe(socket);
socket.on('close', function() { runCase(n + 1) });
}
};
+1 -1
View File
@@ -35,7 +35,7 @@ var requestHandler = function(request, response) {
}, 1000);
}, 2000);
fs.createReadStream(__dirname + '/haproxy.conf').pipe(es);
fs.createReadStream(__dirname + '/haproxy.conf').pipe(es, {end: false});
es.onclose = function() {
clearInterval(loop);
+1 -1
View File
@@ -4,7 +4,7 @@
, "author" : "James Coglan <jcoglan@gmail.com> (http://jcoglan.com/)"
, "keywords" : ["websocket", "eventsource"]
, "version" : "0.4.4"
, "version" : "0.5.0"
, "engines" : {"node": ">=0.4.0"}
, "main" : "./lib/faye/websocket"
, "dependencies" : {"websocket-driver": ""}