Skip to content

Commit

Permalink
upgrade shell app dependencies
Browse files Browse the repository at this point in the history
ws 3 removed upgradeReq property:

websockets/ws#1099

this is now a second argument to the connection callback i.e.

    wss.on('connection', function(ws, req){...
  • Loading branch information
ericfranz committed Nov 13, 2019
1 parent cfd3223 commit 8ace013
Show file tree
Hide file tree
Showing 4 changed files with 490 additions and 345 deletions.
4 changes: 2 additions & 2 deletions apps/shell/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ app.use(process.env.PASSENGER_BASE_URI || '/', router);
var server = new http.createServer(app);
var wss = new WebSocket.Server({ server: server });

wss.on('connection', function connection (ws) {
wss.on('connection', function connection (ws, req) {
var match;
var host = process.env.DEFAULT_SSHHOST || 'localhost';
var dir;
Expand All @@ -54,7 +54,7 @@ wss.on('connection', function connection (ws) {
console.log('Connection established');

// Determine host and dir from request URL
if (match = ws.upgradeReq.url.match(process.env.PASSENGER_BASE_URI + '/ssh/([^\\/]+)(.+)?$')) {
if (match = req.url.match(process.env.PASSENGER_BASE_URI + '/ssh/([^\\/]+)(.+)?$')) {
if (match[1] !== 'default') host = match[1];
if (match[2]) dir = decodeURIComponent(match[2]);
}
Expand Down
338 changes: 0 additions & 338 deletions apps/shell/npm-shrinkwrap.json

This file was deleted.

Loading

0 comments on commit 8ace013

Please sign in to comment.