Skip to content

Commit

Permalink
fix: websockets for terminal not working on subPath
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Hellier <me@tomhellier.com>
  • Loading branch information
TomHellier committed Jun 27, 2022
1 parent a041bf8 commit 380ad88
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -141,8 +141,9 @@ export const PodTerminalViewer: React.FC<PodTerminalViewerProps> = ({selectedNod

function setupConnection() {
const {name = '', namespace = ''} = selectedNode || {};
const url = `${location.host}${appContext.baseHref}`.replace(/\/$/, '');
webSocket = new WebSocket(
`${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/terminal?pod=${name}&container=${AppUtils.getContainerName(
`${location.protocol === 'https:' ? 'wss' : 'ws'}://${url}/terminal?pod=${name}&container=${AppUtils.getContainerName(
podState,
activeContainer
)}&appName=${applicationName}&projectName=${projectName}&namespace=${namespace}`
Expand Down

0 comments on commit 380ad88

Please sign in to comment.