diff --git a/bws.js b/bws.js index 8102e3b..c3f6b90 100755 --- a/bws.js +++ b/bws.js @@ -5,6 +5,8 @@ var fs = require('fs'); var ExpressApp = require('./lib/expressapp'); var WsApp = require('./lib/wsapp'); var config = require('./config'); +var sticky = require('sticky-session'); + var port = process.env.BWS_PORT || config.port || 3232; @@ -22,7 +24,7 @@ if (config.https) { var startOne = function() { var app = ExpressApp.start(config); - var server = config.https ? serverModule.createServer(serverOpts, app) : + var server = config.https ? sticky(serverModule.createServer(serverOpts, app)) : serverModule.Server(app); var ws = WsApp.start(server, config); server.listen(port); diff --git a/package.json b/package.json index e5add84..979d51b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "bitcore-wallet-service", "description": "A service for Mutisig HD Bitcoin Wallets", "author": "BitPay Inc", - "version": "0.0.25", + "version": "0.0.26", "keywords": [ "bitcoin", "copay", @@ -41,6 +41,7 @@ "sjcl": "^1.0.2", "socket.io": "^1.3.5", "socket.io-client": "^1.3.5", + "sticky-session": "^0.1.0", "uuid": "*" }, "devDependencies": { @@ -58,11 +59,14 @@ "test": "./node_modules/.bin/mocha", "coveralls": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" }, - "contributors": [{ - "name": "Ivan Socolsky", - "email": "ivan@bitpay.com" - }, { - "name": "Matias Alejo Garcia", - "email": "ematiu@gmail.com" - }] + "contributors": [ + { + "name": "Ivan Socolsky", + "email": "ivan@bitpay.com" + }, + { + "name": "Matias Alejo Garcia", + "email": "ematiu@gmail.com" + } + ] }