Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03aebd19fb | |||
| 90c8eb4626 | |||
| 3f8e7acd39 | |||
| 85709bb915 | |||
| 998a1725ea |
@@ -1,3 +1,13 @@
|
||||
### 0.7.3 / 2019-06-13
|
||||
|
||||
- Cap version of http-parser-js below 0.4.11, which introduced a bug that
|
||||
prevents us from handling messages that are part of the same input buffer as
|
||||
the handshake response if chunked encoding is specified
|
||||
|
||||
### 0.7.2 / 2019-06-13
|
||||
|
||||
(This version was pulled due to an error when publishing)
|
||||
|
||||
### 0.7.1 / 2019-06-10
|
||||
|
||||
- Catch any exceptions produced while generating a handshake response and send a
|
||||
@@ -7,6 +17,7 @@
|
||||
- Use the `Buffer.alloc()` and `Buffer.from()` functions instead of the unsafe
|
||||
`Buffer()` constructor
|
||||
- Handle errors encountered while handling malformed draft-76 requests
|
||||
- Change license from MIT to Apache 2.0
|
||||
|
||||
### 0.7.0 / 2017-09-11
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ var driver = websocket.client('ws://www.example.com/socket'),
|
||||
proxy = driver.proxy('http://username:password@proxy.example.com'),
|
||||
tcp = net.connect(80, 'proxy.example.com');
|
||||
|
||||
tcp.pipe(proxy).pipe(tcp, {end: false});
|
||||
tcp.pipe(proxy).pipe(tcp, { end: false });
|
||||
|
||||
tcp.on('connect', function() {
|
||||
proxy.start();
|
||||
|
||||
@@ -5,11 +5,11 @@ var net = require('net'),
|
||||
websocket = require('..'),
|
||||
deflate = require('permessage-deflate');
|
||||
|
||||
var DEFAULT_PORTS = {'ws:': 80, 'wss:': 443};
|
||||
var DEFAULT_PORTS = { 'ws:': 80, 'wss:': 443 };
|
||||
|
||||
var uri = url.parse(process.argv[2]),
|
||||
port = uri.port || DEFAULT_PORTS[uri.protocol],
|
||||
conn = net.connect({host: uri.hostname, port: port});
|
||||
conn = net.connect({ host: uri.hostname, port: port });
|
||||
|
||||
var driver = websocket.client(uri.href);
|
||||
driver.addExtension(deflate);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
// Protocol references:
|
||||
//
|
||||
//
|
||||
// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75
|
||||
// * http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76
|
||||
// * http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17
|
||||
|
||||
@@ -8,7 +8,7 @@ var Buffer = require('safe-buffer').Buffer,
|
||||
Headers = require('./headers'),
|
||||
HttpParser = require('../http_parser');
|
||||
|
||||
var PORTS = {'ws:': 80, 'wss:': 443};
|
||||
var PORTS = { 'ws:': 80, 'wss:': 443 };
|
||||
|
||||
var Proxy = function(client, origin, options) {
|
||||
this._client = client;
|
||||
|
||||
+3
-3
@@ -7,7 +7,7 @@
|
||||
"websocket"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"version": "0.7.1",
|
||||
"version": "0.7.3",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
},
|
||||
@@ -16,8 +16,8 @@
|
||||
],
|
||||
"main": "./lib/websocket/driver",
|
||||
"dependencies": {
|
||||
"http-parser-js": ">=0.4.0",
|
||||
"safe-buffer": ">=5.1.1",
|
||||
"http-parser-js": ">=0.4.0 <0.4.11",
|
||||
"safe-buffer": ">=5.1.0",
|
||||
"websocket-extensions": ">=0.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -4,7 +4,7 @@ var Client = require("../../../lib/websocket/driver/client"),
|
||||
|
||||
test.describe("Client", function() { with(this) {
|
||||
define("options", function() {
|
||||
return this._options = this._options || {protocols: this.protocols()}
|
||||
return this._options = this._options || { protocols: this.protocols() }
|
||||
})
|
||||
|
||||
define("protocols", function() {
|
||||
@@ -202,7 +202,7 @@ test.describe("Client", function() { with(this) {
|
||||
}})
|
||||
|
||||
it("emits an 'error' event if the proxy does not connect", function() { with(this) {
|
||||
expect(proxy, "emit").given("error", objectIncluding({message: "Can't establish a connection to the server at ws://www.example.com/socket"}))
|
||||
expect(proxy, "emit").given("error", objectIncluding({ message: "Can't establish a connection to the server at ws://www.example.com/socket" }))
|
||||
expect(proxy, "emit").given("close")
|
||||
expect(proxy, "emit").given("end")
|
||||
proxy.write(Buffer.from("HTTP/1.1 403 Forbidden\r\n\r\n"))
|
||||
|
||||
@@ -14,7 +14,7 @@ test.describe("Draft75", function() { with(this) {
|
||||
})
|
||||
|
||||
define("options", function() {
|
||||
return this._options = this._options || {masking: false}
|
||||
return this._options = this._options || { masking: false }
|
||||
})
|
||||
|
||||
define("driver", function() {
|
||||
|
||||
@@ -27,7 +27,7 @@ test.describe("Draft76", function() { with(this) {
|
||||
})
|
||||
|
||||
define("options", function() {
|
||||
return this._options = this._options || {masking: false}
|
||||
return this._options = this._options || { masking: false }
|
||||
})
|
||||
|
||||
define("driver", function() {
|
||||
|
||||
@@ -17,7 +17,7 @@ test.describe("Hybi", function() { with(this) {
|
||||
})
|
||||
|
||||
define("options", function() {
|
||||
return this._options = this._options || {masking: false}
|
||||
return this._options = this._options || { masking: false }
|
||||
})
|
||||
|
||||
define("driver", function() {
|
||||
|
||||
Reference in New Issue
Block a user