Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Allow running fully on port 443 (wss:// is hardcoded to use 8443 in minified JS) #75

Closed
mappu opened this issue Mar 26, 2020 · 2 comments · Fixed by #143
Closed

Allow running fully on port 443 (wss:// is hardcoded to use 8443 in minified JS) #75

mappu opened this issue Mar 26, 2020 · 2 comments · Fixed by #143
Assignees

Comments

@mappu
Copy link

mappu commented Mar 26, 2020

I spent some time today trying to get ion working on port 443, but always it would make a websocket request on port 8443.

I tracked it down to the minified ion-conference.js, in the unminified src/Client.js, that sets this unconditionally:

        this._port = 8443;

that's used by _getProtooUrl.

@cloudwebrtc cloudwebrtc self-assigned this Mar 26, 2020
@moqmar
Copy link

moqmar commented Mar 29, 2020

So, I solved this (together with #72) by using the following Caddyfile:

{$WWW_URL} {
  tls {$ADMIN_EMAIL}
  root /app/demo/dist
  proxy /ws biz:8443 {
    transparent
    websocket
    header_upstream Sec-WebSocket-Protocol {>Sec-WebSocket-Protocol}
  }
}

Then, you just need to set this._port to 443, either in src/Client.js when building manually or by just running 'sed -i s/8443/443/g web/ion-conference.js' on the minified version (untested). I guess the port can also just be taken from the current location instead of setting it manually in the client then...

@moqmar
Copy link

moqmar commented Mar 29, 2020

Well, the Caddyfile requires WWW_URL to include a port (example.org:80) or a scheme (http://example.org), otherwise the default port will be 2015...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants