File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,17 +96,12 @@ class SFUClient {
9696 this . sfuPort = sfu_port ;
9797
9898 let sfuEndpoint ;
99- try {
100- const urlObj = new URL ( sfu_url ) ;
101- const defaultPort = urlObj . protocol === "https:" ? "443" : "80" ;
102- // If port is empty/null OR matches default for the scheme, omit.
103- if ( ! sfu_port || String ( sfu_port ) === defaultPort ) {
104- sfuEndpoint = urlObj . origin ;
105- } else {
106- sfuEndpoint = `${ urlObj . protocol } //${ urlObj . hostname } :${ sfu_port } ` ;
107- }
108- } catch ( e ) {
109- sfuEndpoint = sfu_port ? `${ sfu_url } :${ sfu_port } ` : sfu_url ;
99+ const urlObj = new URL ( sfu_url ) ;
100+ const isSecured = urlObj . protocol === "https:" ;
101+ if ( isSecured ) {
102+ sfuEndpoint = urlObj . origin ;
103+ } else {
104+ sfuEndpoint = `${ urlObj . protocol } //${ urlObj . hostname } :${ sfu_port } ` ;
110105 }
111106
112107 try {
You can’t perform that action at this time.
0 commit comments