-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathserver.js
28 lines (28 loc) · 1.05 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const emulator=new V86Starter({
wasm_path: "https://cors-anywhere.9pfs.repl.co/copy.sh/v86/build/v86.wasm",
cdrom: {
url: "https://cors-anywhere.9pfs.repl.co/k.copy.sh/linux3.iso"
},
vga_bios: {
url: "https://cors-anywhere.9pfs.repl.co/copy.sh/v86/bios/vgabios.bin"
},
bios: {
url: "https://cors-anywhere.9pfs.repl.co/copy.sh/v86/bios/seabios.bin"
},
autostart: true,
// disable_keyboard: true,
screen_container: document.getElementById("screen"),
network_relay_url: "wss://relay.widgetry.org/",
});
var term=new Terminal();
Terminal.applyAddon(fullscreen);
term.open(document.getElementById("terminal"));
const b=new Bugout({announce: ["wss://p2p-tracker.9pfs.repl.co/","wss://p2p-tracker.glitch.me/"]});
term.writeln("Address: " + b.address());
b.on("seen",function(address) {term.writeln("Seen " + address)});
b.on("rpc",function(address, call, args) {
if(call=="key") {
emulator.serial0_send(atob(args[0]));
}
});
emulator.add_listener("serial0-output-char", (char) => b.send(btoa(char)));