File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/packages/frontend/frame-editors/x11-editor Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -156,17 +156,18 @@ export class XpraClient extends EventEmitter {
156156 // Get origin, but with http[s] stripped.
157157 // Do not use window.location.hostname, since that doesn't
158158 // include the port, if there is one.
159- let origin = window . location . origin ;
159+ const { origin, protocol : pageProtocol } = window . location ;
160160 const i = origin . indexOf ( ":" ) ;
161- origin = origin . slice ( i ) ;
161+ const originTail = origin . slice ( i ) ;
162+ const wsProtocol = pageProtocol === "https:" ? "wss" : "ws" ;
162163
163164 const path = join (
164165 appBasePath ,
165166 this . options . project_id ,
166167 "server" ,
167168 `${ port } ` ,
168169 ) ;
169- const uri = `wss ${ origin } ${ path } ` ;
170+ const uri = `${ wsProtocol } ${ originTail } ${ path } ` ;
170171 const dpi = Math . round ( BASE_DPI * window . devicePixelRatio ) ;
171172 return { uri, dpi } ;
172173 }
You can’t perform that action at this time.
0 commit comments