Tschuck / battletris

RPG based multiplayer tetris using vue.js
https://battletris.de
GNU General Public License v3.0
8 stars 1 forks source link

Automatically use wss:// and https:// for backend connection #24

Closed janheinrichmerker closed 2 years ago

janheinrichmerker commented 2 years ago

Currently there are environment variables that tell the frontend where to connect to the backend. These specify protocol and hostname. Though with mixed-content not being supported by many browsers it seems unnecessary to allow users to specify e.g. a ws:// Web socket when deploying the App via https:// (as most browsers wouldn't load the insecure Web socket connteciton). So we could automatically determine wether to use wss:// or ws:// based on the current window.location.protocol. Only the hostname would then be required from environment variables.

janheinrichmerker commented 2 years ago

Closing due to inactivity.