Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #162 from apollographql/chore/deps
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
Urigo authored Jun 4, 2017
2 parents 90f271d + 3b80b94 commit 9f570f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "git+https://github.com/apollostack/subscriptions-transport-ws.git"
},
"dependencies": {
"@types/ws": "^0.0.41",
"@types/ws": "^3.0.0",
"backo2": "^1.0.2",
"eventemitter3": "^2.0.3",
"graphql-subscriptions": "^0.4.1",
Expand All @@ -25,7 +25,7 @@
"pretest": "npm run compile",
"test": "npm run testonly --",
"posttest": "npm run lint",
"lint": "tslint --format=stylish --type-check --project ./tsconfig.json",
"lint": "tslint --format stylish --type-check --project ./tsconfig.json",
"watch": "tsc -w",
"testonly": "mocha --reporter spec --full-trace ./dist/test/**/*.js",
"coverage": "node ./node_modules/istanbul/lib/cli.js cover _mocha -- --full-trace ./dist/test/tests.js",
Expand All @@ -34,20 +34,20 @@
"prepublish": "npm run compile && npm run browser-compile"
},
"devDependencies": {
"@types/chai": "^3.5.1",
"@types/chai": "^4.0.0",
"@types/graphql": "^0.9.0",
"@types/lodash": "4.14.64",
"@types/lodash": "^4.14.65",
"@types/mocha": "^2.2.41",
"@types/node": "^7.0.22",
"@types/sinon": "^2.1.3",
"@types/node": "^7.0.27",
"@types/sinon": "^2.3.0",
"chai": "^3.5.0",
"istanbul": "^1.0.0-alpha.2",
"graphql": "^0.10.0",
"istanbul": "^1.0.0-alpha.2",
"lodash": "^4.17.1",
"mocha": "^3.3.0",
"remap-istanbul": "^0.9.5",
"sinon": "^2.1.0",
"tslint": "^5.1.0",
"tslint": "^5.4.2",
"typescript": "^2.3.0",
"webpack": "^2.4.1"
},
Expand Down
4 changes: 3 additions & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export class SubscriptionServer {
this.wsServer = new WebSocket.Server(socketOptions || {});

this.wsServer.on('connection', ((socket: WebSocket, request: IncomingMessage) => {
socket.upgradeReq = request;
// Add `upgradeReq` to the socket object to support old API, without creating a memory leak
// See: https://github.com/websockets/ws/pull/1099
(socket as any).upgradeReq = request;
// NOTE: the old GRAPHQL_SUBSCRIPTIONS protocol support should be removed in the future
if (socket.protocol === undefined ||
(socket.protocol.indexOf(GRAPHQL_WS) === -1 && socket.protocol.indexOf(GRAPHQL_SUBSCRIPTIONS) === -1)) {
Expand Down

0 comments on commit 9f570f5

Please sign in to comment.