fix: Terminal WS ueber Nginx-Proxy statt direkt zum Backend (kein self-signed Cert Problem)
This commit is contained in:
parent
257eee0c83
commit
e44bd314e8
@ -54,11 +54,11 @@ export default function TerminalModal({ agentId, agentName, onClose }) {
|
||||
xtermRef.current = term
|
||||
fitRef.current = fitAddon
|
||||
|
||||
// WebSocket verbinden
|
||||
// WebSocket verbinden — ueber Nginx-Proxy (gleicher Origin, kein Zertifikatsproblem)
|
||||
const cols = term.cols || 220
|
||||
const rows = term.rows || 50
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'wss:'
|
||||
const wsUrl = `wss://${backendHost}:8443/api/v1/agents/${agentId}/terminal?cols=${cols}&rows=${rows}&api_key=${apiKey}`
|
||||
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
const wsUrl = `${wsProtocol}//${window.location.host}/api/v1/agents/${agentId}/terminal?cols=${cols}&rows=${rows}&api_key=${apiKey}`
|
||||
|
||||
const ws = new WebSocket(wsUrl)
|
||||
ws.binaryType = 'arraybuffer'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user