ws => wss
All checks were successful
/ mirror_to_github (push) Successful in 43s
/ test (push) Successful in 7s

This commit is contained in:
Leon van Kammen 2025-04-08 15:33:52 +02:00
parent d4bddd7d38
commit 175b70953e
2 changed files with 8 additions and 6 deletions

View file

@ -17,7 +17,7 @@ ISOTerminal.prototype.enableRemoteKeyboard = function(opts){
this.send(clearScreen);
this.send(`\n\rfor instructions\n\rsee ${document.location.origin}/index.html#Remote%20keyboard\n\n\r`)
this.send("enter 'm' for mainmenu\n\n\r")
this.send("keyboard ip-adress> ")
this.send("keyboard ip-address> ")
// autofill ip
if( service.ip ){
for( let i = 0; i < service.ip.length; i++ ) this.send(service.ip.charAt(i))
@ -26,11 +26,12 @@ ISOTerminal.prototype.enableRemoteKeyboard = function(opts){
},
server: (term) => {
try{
service.addr = `ws://${service.ip}:9090/`;
service.addr = `wss://${service.ip}:9090/`;
service.ws = new WebSocket(service.addr)
service.ws.addEventListener("open", () => {
service.ws.addEventListener("error", console.error )
service.ws.addEventListener("open", (e) => {
if( service.state == 'listening' ){
this.send(`\n\rconnected to ${service.addr}! \\o/\n\r`)
this.send(`\n\rconnected! \\o/\n\r`)
this.bootMenu()
}
service.state = 'receiving'
@ -76,9 +77,9 @@ ISOTerminal.prototype.enableRemoteKeyboard = function(opts){
this.send("\n\r")
this.bootMenu()
}else if( ch == '\n' || ch == '\r'){
this.send("\n\rwaiting for connection..")
service.server(this)
service.state = 'listening'
this.send("\n\rconnecting to "+service.addr)
}else{
service.ip = ch == '\b' ? service.ip.substr(0,this.service.ip.length-1)
: service.ip + ch

View file

@ -106,7 +106,8 @@ this.addOverlayFS = async function(opts){
fetch(opts.overlayfs)
.then( (f) => {
f.arrayBuffer().then( (buf) => {
this.emulator.create_file('overlayfs.zip', new Uint8Array(buf) )
let filename = opts.overlayfs.match(/\.zip$/) ? 'overlayfs.zip' : '.env'
this.emulator.create_file( filename, new Uint8Array(buf) )
})
})
}