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

Commit

Permalink
chore(deps): updated dependencies and usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Jun 4, 2017
1 parent 870cc7c commit 3b80b94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 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 @@ -34,9 +34,9 @@
"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.27",
"@types/sinon": "^2.3.0",
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 3b80b94

Please sign in to comment.