@@ -79,7 +79,7 @@ function createSessionData (
79
79
nodeUri : string ,
80
80
sessionDurationMillis : number ,
81
81
slot : any ,
82
- hostname : string
82
+ origin : string
83
83
) : SessionData {
84
84
const parsed = JSON . parse ( capabilities ) as Capabilities
85
85
const browserName = parsed . browserName
@@ -88,8 +88,10 @@ function createSessionData (
88
88
let vnc : string = parsed [ 'se:vnc' ] ?? ''
89
89
if ( vnc . length > 0 ) {
90
90
try {
91
- const url = new URL ( vnc )
92
- url . hostname = hostname
91
+ const url = new URL ( origin )
92
+ const vncUrl = new URL ( vnc )
93
+ url . pathname = vncUrl . pathname
94
+ url . protocol = 'https:' === url . protocol ? 'wss:' : 'ws:'
93
95
vnc = url . href
94
96
} catch ( error ) {
95
97
console . log ( error )
@@ -252,7 +254,7 @@ const useStyles = (theme: Theme): StyleRules => createStyles(
252
254
253
255
interface RunningSessionsProps {
254
256
sessions : SessionData [ ]
255
- hostname : string
257
+ origin : string
256
258
classes : any
257
259
}
258
260
@@ -373,7 +375,7 @@ class RunningSessions extends React.Component<RunningSessionsProps, RunningSessi
373
375
}
374
376
375
377
render ( ) : ReactNode {
376
- const { sessions, hostname , classes } = this . props
378
+ const { sessions, origin , classes } = this . props
377
379
const {
378
380
dense,
379
381
order,
@@ -394,7 +396,7 @@ class RunningSessions extends React.Component<RunningSessionsProps, RunningSessi
394
396
session . nodeUri ,
395
397
session . sessionDurationMillis ,
396
398
session . slot ,
397
- hostname
399
+ origin
398
400
)
399
401
} )
400
402
const emptyRows = rowsPerPage - Math . min ( rowsPerPage , rows . length - page * rowsPerPage )
0 commit comments