Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builds/browser/es5/jsonrpc.min.js

Large diffs are not rendered by default.

39 changes: 18 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "jsonrpc-bidirectional",
"description": "Bidirectional JSONRPC over web sockets or HTTP with extensive plugin support.",
"version": "2.4.1",
"version": "2.4.5",
"scripts": {
"build": "node build.js",
"test": "node tests/main.js",
"lint": "eslint src tests --quiet"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bigstepinc/jsonrpc-bidirectional.git"
"url": "git+https://github.com/oxygens/jsonrpc-bidirectional.git"
},
"homepage": "https://github.com/bigstepinc/jsonrpc-bidirectional",
"homepage": "https://github.com/oxygens/jsonrpc-bidirectional",
"author": "Ionut Stan <Ionut.Stan@bigstep.com>",
"license": "MIT",
"contributors": [
Expand Down Expand Up @@ -41,24 +41,21 @@
"ws": "^2.2.3"
},
"devDependencies": {
"@types/node": "*",
"babel-core": "*",
"babel-eslint": "*",
"babel-loader": "*",
"babel-plugin-async-to-promises": "*",
"babel-plugin-remove-comments": "*",
"babel-polyfill": "*",
"babel-preset-es2015": "*",
"babel-preset-stage-3": "*",
"babel-runtime": "*",
"eslint": "*",
"eslint-plugin-jsdoc": "*",
"@types/node": "^7.0.13",
"babel-core": "^6.24.1",
"babel-eslint": "^7.2.2",
"babel-loader": "^6.4.1",
"babel-plugin-async-to-promises": "^1.0.5",
"babel-plugin-remove-comments": "^2.0.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-3": "^6.24.1",
"babel-runtime": "^6.23.0",
"eslint": "^3.19.0",
"eslint-plugin-jsdoc": "^3.0.2",
"phantom": "^4.0.2",
"webpack": "*",
"sleep-promise": "*"
},
"optionalDependencies": {
"bufferutil": "^3.0.0",
"utf-8-validate": "^3.0.1"
"sleep-promise": "^2.0.0",
"uglify-js": "^2.8.22",
"webpack": "^2.4.1"
}
}
14 changes: 10 additions & 4 deletions tests/AllTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class AllTests
this._serverAuthorizeAllPlugin = new JSONRPC.Plugins.Server.AuthorizeAll();

this._bWebSocketMode = !!bWebSocketMode;
this._bPreventHTTPAPIRequests = false;

Object.seal(this);
}
Expand All @@ -86,6 +87,9 @@ class AllTests
*/
async runTests()
{
this._bPreventHTTPAPIRequests = this._bWebSocketMode;


await this.triggerConnectionRefused();


Expand Down Expand Up @@ -179,6 +183,9 @@ class AllTests

this._httpServerSiteA = null;
}


this._bPreventHTTPAPIRequests = false;
}


Expand Down Expand Up @@ -233,7 +240,7 @@ class AllTests
return;
}
else if(
this._bWebSocketMode
this._bPreventHTTPAPIRequests
&& !incomingRequest.headers["sec-websocket-version"]
&& incomingRequest.method === "POST"
&& url.parse(incomingRequest.url).pathname.substr(0, 4) === "/api"
Expand Down Expand Up @@ -510,8 +517,7 @@ class AllTests
*/
async endpointNotFoundError()
{
const bWebSocketMode = this._bWebSocketMode;
this._bWebSocketMode = false;
this._bPreventHTTPAPIRequests = false;


console.log("[" + process.pid + "] endpointNotFoundError");
Expand All @@ -538,7 +544,7 @@ class AllTests
}


this._bWebSocketMode = bWebSocketMode;
this._bPreventHTTPAPIRequests = this._bWebSocketMode;
}


Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/main_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ process.on(
await allTests.setupWebsocketServerSiteA();
await allTests.disableServerSecuritySiteA();

console.log("Go to http://localhost:8324/tests/Browser/index.html");
console.log("Go to http://localhost:8324/tests/Browser/index.html?websocketmode=1");
}
)();
6 changes: 5 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ module.exports = [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
sourceMap: true,
compress: { screw_ie8: true },
compress: {
screw_ie8: true,
unused: true,
dead_code: true
},
mangle: {
screw_ie8: true,
except: recursiveKeys.dumpKeysRecursively(require("./index_webpack")).map(
Expand Down