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
|
xtermRef.current = term
|
||||||
fitRef.current = fitAddon
|
fitRef.current = fitAddon
|
||||||
|
|
||||||
// WebSocket verbinden
|
// WebSocket verbinden — ueber Nginx-Proxy (gleicher Origin, kein Zertifikatsproblem)
|
||||||
const cols = term.cols || 220
|
const cols = term.cols || 220
|
||||||
const rows = term.rows || 50
|
const rows = term.rows || 50
|
||||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'wss:'
|
const wsProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||||
const wsUrl = `wss://${backendHost}:8443/api/v1/agents/${agentId}/terminal?cols=${cols}&rows=${rows}&api_key=${apiKey}`
|
const wsUrl = `${wsProtocol}//${window.location.host}/api/v1/agents/${agentId}/terminal?cols=${cols}&rows=${rows}&api_key=${apiKey}`
|
||||||
|
|
||||||
const ws = new WebSocket(wsUrl)
|
const ws = new WebSocket(wsUrl)
|
||||||
ws.binaryType = 'arraybuffer'
|
ws.binaryType = 'arraybuffer'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user