diff --git a/README.md b/README.md index ad8c2a2fbe5a94dd4d9c7fa55bc0f93c034f51b9..6ab5223c7a2fa8424a6d95fcb7b6788e19258b4d 100644 --- a/README.md +++ b/README.md @@ -31,18 +31,6 @@ brew cask install jitsi-meet ### Using it with your own Jitsi Meet installation -In order to use this application with your own Jitsi Meet installation it's -necessary to enable the External API. Your server must serve a `external_api.js` -file at the root of the installation. - -Here is an example using nginx: - -``` -location /external_api.js { - alias /usr/share/jitsi-meet/libs/external_api.min.js; -} -``` - :warning: The following additional HTTP headers are known to break the Electron App: ``` diff --git a/app/features/settings/components/ServerURLField.js b/app/features/settings/components/ServerURLField.js index 09ae9451de7c1e223890cdb5f66c41c7da52c926..b069ebadee6a739712932f58c40baba0254e392e 100644 --- a/app/features/settings/components/ServerURLField.js +++ b/app/features/settings/components/ServerURLField.js @@ -9,7 +9,7 @@ import type { Dispatch } from 'redux'; import { compose } from 'redux'; import config from '../../config'; -import { getExternalApiURL } from '../../utils'; +import { normalizeServerURL } from '../../utils'; import { setServerURL } from '../actions'; import { Form } from '../styled'; @@ -122,25 +122,32 @@ class ServerURLField extends Component<Props, State> { } /** - * Validates the Server URL by fetching external_api.js using the HEAD - * method. + * Validates the Server URL. * * @returns {void} */ _validateServerURL() { - fetch(getExternalApiURL(this.state.serverURL), { - method: 'HEAD' - }) - .then((response: Object) => { - this.setState({ - isValid: response.ok - }); - }) - .catch(() => { - this.setState({ - isValid: false - }); - }); + if (!this.state.serverURL.trim()) { + return true; + } + + const url = normalizeServerURL(this.state.serverURL); + let isValid; + + try { + // eslint-disable-next-line no-new + const tmp = new URL(url); + + if (!tmp.protocol.startsWith('http')) { + throw new Error('Invalid protocol'); + } + + isValid = true; + } catch (_) { + isValid = false; + } + + this.setState({ isValid }); } } diff --git a/app/features/utils/functions.js b/app/features/utils/functions.js index e8e11e255a17c877624678bc12a074485de4a05e..36db8b30be20de375df3a18efaa6bba5f8d3dbb5 100644 --- a/app/features/utils/functions.js +++ b/app/features/utils/functions.js @@ -2,22 +2,6 @@ // @flow -import config from '../config'; - -/** - * Returns the URL of the external_api.js of the server. - * - * @param {string} serverURL - Jitsi Meet Server URL. - * @returns {string} - The external_api.js URL. - */ -export function getExternalApiURL(serverURL: string) { - if (!serverURL) { - // eslint-disable-next-line no-param-reassign - serverURL = config.defaultServerURL; - } - - return `${normalizeServerURL(serverURL)}/external_api.js`; -} /** * Return true if Electron app is running on Mac system. diff --git a/app/i18n/lang/en.json b/app/i18n/lang/en.json index 20e42defe358c20d32bdcdc395dde95497cc9957..df26637847eb6004ce37104b36ac3a0352b19b05 100644 --- a/app/i18n/lang/en.json +++ b/app/i18n/lang/en.json @@ -31,7 +31,7 @@ "alwaysOnTopWindow": "Always on Top Window", "startWithAudioMuted": "Start with Audio muted", "startWithVideoMuted": "Start with Video muted", - "invalidServer": "Invalid Server URL or external API not enabled", + "invalidServer": "Invalid Server URL", "invalidServerTimeout": "Invalid value for Server Timeout", "serverUrl": "Server URL", "serverTimeout": "Server Timeout (in seconds)" diff --git a/app/i18n/lang/es.json b/app/i18n/lang/es.json index a6c3ae59fa113203b6c63d36731a84c84af0cd6f..cea54bcca973588a94d097512a2d93eb3bdfa87a 100644 --- a/app/i18n/lang/es.json +++ b/app/i18n/lang/es.json @@ -31,7 +31,7 @@ "alwaysOnTopWindow": "Ventana siempre encima", "startWithAudioMuted": "Iniciar con audio desactivado", "startWithVideoMuted": "Iniciar con video desactivado", - "invalidServer": "URL del servidor inválido o API externo no habilitada", + "invalidServer": "URL del servidor inválida", "serverUrl": "URL del servidor", "serverTimeout": "Tiempo de desconexión del servidor (en segundos)" } diff --git a/app/i18n/lang/fr.json b/app/i18n/lang/fr.json index 73394bbc48056b095570083772665a93a4b8789e..e1c91cae05e7afd98f6464ccd0cc4998b3d88d7c 100644 --- a/app/i18n/lang/fr.json +++ b/app/i18n/lang/fr.json @@ -31,7 +31,7 @@ "alwaysOnTopWindow": "Fenêtre Toujours au Dessus", "startWithAudioMuted": "Démarrer avec le micro coupé", "startWithVideoMuted": "Démarrer avec la caméra coupée", - "invalidServer": "URL invalide ou API externe non activée", + "invalidServer": "URL invalide", "serverUrl": "URL du serveur", "serverTimeout": "Délai de connexion au server (en secondes)" } diff --git a/app/i18n/lang/hu.json b/app/i18n/lang/hu.json index 13302086b26b1e1d55bcdf561ff006769a080c14..0a3ea767c6a219b22ac6003bd138fda2c1a12d31 100644 --- a/app/i18n/lang/hu.json +++ b/app/i18n/lang/hu.json @@ -31,7 +31,7 @@ "alwaysOnTopWindow": "Mindig látható", "startWithAudioMuted": "ElnémÃtva kezd", "startWithVideoMuted": "Videó nélkül kezd", - "invalidServer": "Érvénytelen kiszolgáló URL-cÃme vagy külsÅ‘ API nincs engedélyezve", + "invalidServer": "Érvénytelen kiszolgáló URL-cÃme", "invalidServerTimeout": "A kiszolgáló idÅ‘korlátja érvénytelen", "serverUrl": "Kiszolgáló URL-cÃme", "serverTimeout": "Kiszolgálói idÅ‘korlát (másodperc)" diff --git a/app/i18n/lang/it.json b/app/i18n/lang/it.json index b0153138b1c2278262abb11ee4a959c08c55088d..8352454d763551170305d48362e3dce296b544c9 100644 --- a/app/i18n/lang/it.json +++ b/app/i18n/lang/it.json @@ -31,7 +31,7 @@ "alwaysOnTopWindow": "Finestra sempre in primo piano", "startWithAudioMuted": "Inizia senza audio", "startWithVideoMuted": "Inizio senza video", - "invalidServer": "URL del server errato o il server non supporta un'API esterna", + "invalidServer": "URL del server errato", "serverUrl": "URL Server", "serverTimeout": "Timeout del server (in secondi)" } diff --git a/app/i18n/lang/ru.json b/app/i18n/lang/ru.json index abb85fe70d39e04f5259bdfedb6963b962852e99..8af1f43cdfc43f760495fae0d5a599c297f37bae 100644 --- a/app/i18n/lang/ru.json +++ b/app/i18n/lang/ru.json @@ -31,7 +31,7 @@ "alwaysOnTopWindow": "Поверх вÑех окон", "startWithAudioMuted": "Ðачать без звука", "startWithVideoMuted": "Ðачать без видео", - "invalidServer": "Ðеверный URL-Ð°Ð´Ñ€ÐµÑ Ñервера или внешний API не включен", + "invalidServer": "Ðеверный URL-Ð°Ð´Ñ€ÐµÑ Ñервера", "serverUrl": "URL-Ð°Ð´Ñ€ÐµÑ Ñервера", "serverTimeout": "Тайм-аут Ñервера (в Ñекундах)" }