Mercurial > hg > rlgwebd
annotate webtty @ 210:b04313038a0b
Changes for compatibility with recent versions of NodeJS.
The pty.js module is replaced with node-pty, now-mandatory callbacks
are added to various fs functions, and deprecated Buffer() calls are
replaced with Buffer.from() or Buffer.alloc().
| author | John "Elwin" Edwards |
|---|---|
| date | Sun, 25 Aug 2019 21:27:31 -0400 |
| parents | 3bdee6371c3f |
| children |
| rev | line source |
|---|---|
|
0
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
1 #!/usr/bin/env node |
| 137 | 2 |
| 3 var localModules = '/usr/lib/node_modules/'; | |
|
0
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
4 var http = require('http'); |
|
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
5 var url = require('url'); |
|
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
6 var path = require('path'); |
|
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
7 var fs = require('fs'); |
| 137 | 8 var pty = require(path.join(localModules, "pty.js")); |
| 140 | 9 var child_process = require("child_process"); |
| 10 var webSocketServer = require(path.join(localModules, "websocket")).server; | |
|
0
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
11 |
| 137 | 12 var serveStaticRoot = fs.realpathSync("."); |
|
0
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
13 var sessions = {}; |
| 153 | 14 var nsessid = 0; |
|
0
bd412f63ce0d
Put this project under version control, finally.
John "Elwin" Edwards <elwin@sdf.org>
parents:
diff
changeset
|
15 |
|
2
98bf7c94c954
webtty.js: set up the environment and working directory.
John "Elwin" Edwards <elwin@sdf.org>
parents:
0
diff
changeset
|
16 var env_dontuse = {"TMUX": true, "TMUX_PANE": true}; |
|
98bf7c94c954
webtty.js: set up the environment and working directory.
John "Elwin" Edwards <elwin@sdf.org> |
