Update url!

This commit is contained in:
retoor 2025-06-10 15:59:41 +02:00
parent 60afefac96
commit 06f28fd426

View File

@ -25,7 +25,7 @@ export class Container extends EventHandler{
}); });
} }
this.refresh() //this.refresh()
this.terminal.focus() this.terminal.focus()
} }
refresh(){ refresh(){
@ -40,8 +40,6 @@ export class Container extends EventHandler{
this._fitAddon.fit(); this._fitAddon.fit();
} }
constructor(channelUid,log){ constructor(channelUid,log){
super() super()
this.terminal = new Terminal({ cursorBlink: true ,theme: { this.terminal = new Terminal({ cursorBlink: true ,theme: {
@ -63,7 +61,15 @@ export class Container extends EventHandler{
this.terminal.write(new TextDecoder().decode(fixedData)); this.terminal.write(new TextDecoder().decode(fixedData));
}) })
this.ws = new WebSocket(`/container/sock/${channelUid}.json`)
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = window.location.host;
const wsUrl = `${protocol}//${host}/container/sock/${this.channelUid}.json`;
this.ws = new WebSocket(wsUrl);
this.ws.binaryType = "arraybuffer"; // Support binary data this.ws.binaryType = "arraybuffer"; // Support binary data
this.ws.onmessage = (event) => { this.ws.onmessage = (event) => {
this.emit("stdout", event.data) this.emit("stdout", event.data)