xLightsSequencer / xLights

xLights is a sequencer for Lights. xLights has usb and E1.31 drivers. You can create sequences in this object oriented program. You can create playlists, schedule them, test your hardware, convert between different sequencers.
GNU General Public License v3.0
569 stars 212 forks source link

Add support for WSS Websockets #2516

Open Shane8johnson opened 3 years ago

Shane8johnson commented 3 years ago

I am suggesting the following code (or similar) be used to connect to websockets when using the xSchedule Web Interface to determine if a Secure Web Socket is needed vs a standard Web Socket. This is useful is a user is a using a tunneling protocol (Ngrok, Portmap.io, ect.) that is using the HTTPS web protocol to connect to xScheduleWeb.

if (window.location.protocol === 'https:'){
    url = 'wss://' + location.hostname + (location.port ? ':' + location.port : '');
    }
    else {
    url = 'ws://' + location.hostname + (location.port ? ':' + location.port : '');
    }

The following code would need to be implemented in two spaces: The guestbuttons.html page and the webSocket.js file within the xschedule web directory. (and any other files that are using the default url = 'ws://' that I am unaware of)

Shane8johnson commented 3 years ago

Additionally, please reference Add support for SSL when using the xSchedule Web interface #2517