Browse Source

update pty to maintained version

pull/123/head
cbutler 7 years ago
parent
commit
581ef86449
No known key found for this signature in database GPG Key ID: 9EB3D625BD14DDEC
  1. 2
      package.json
  2. 7
      wetty.mjs

2
package.json

@ -38,7 +38,7 @@
"fs-extra": "^4.0.1",
"optimist": "^0.6",
"pre-commit": "^1.2.2",
"pty.js": "^0.3.1",
"node-pty": "^0.7.4",
"serve-favicon": "^2.4.3",
"socket.io": "^1.3.7"
},

7
wetty.mjs

@ -3,7 +3,7 @@ import http from 'http';
import https from 'https';
import path from 'path';
import server from 'socket.io';
import pty from 'pty.js';
import { spawn } from 'node-pty';
import EventEmitter from 'events';
import favicon from 'serve-favicon';
@ -58,13 +58,12 @@ function getCommand(socket, sshuser, sshhost, sshport, sshauth) {
}
export default function start(port, sshuser, sshhost, sshport, sshauth, sslopts) {
const httpserv = createServer(port, sslopts);
const events = new EventEmitter();
const io = server(httpserv, { path: '/wetty/socket.io' });
const io = server(createServer(port, sslopts), { path: '/wetty/socket.io' });
io.on('connection', socket => {
console.log(`${new Date()} Connection accepted.`);
const [args, ssh] = getCommand(socket, sshuser, sshhost, sshport, sshauth);
const term = pty.spawn('/usr/bin/env', args, {
const term = spawn('/usr/bin/env', args, {
name: 'xterm-256color',
cols: 80,
rows: 30,

Loading…
Cancel
Save