vortexa64 commited on
Commit
e626888
·
verified ·
1 Parent(s): 249125e

Create public/index.html

Browse files
Files changed (1) hide show
  1. public/index.html +25 -0
public/index.html ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Virtual Private Console</title>
5
+ <link rel="stylesheet" href="style.css">
6
+ <link rel="stylesheet" href="https://unpkg.com/xterm/css/xterm.css" />
7
+ </head>
8
+ <body>
9
+ <div id="terminal"></div>
10
+ <script src="https://unpkg.com/xterm/lib/xterm.js"></script>
11
+ <script>
12
+ const socket = new WebSocket("ws://" + location.host);
13
+ const term = new Terminal();
14
+ term.open(document.getElementById('terminal'));
15
+
16
+ term.onData(data => {
17
+ socket.send(data);
18
+ });
19
+
20
+ socket.onmessage = e => {
21
+ term.write(e.data);
22
+ };
23
+ </script>
24
+ </body>
25
+ </html>