diff --git a/frontend/src/models/Coordinator.model.ts b/frontend/src/models/Coordinator.model.ts index 3ae5e6b8..0b44ba68 100644 --- a/frontend/src/models/Coordinator.model.ts +++ b/frontend/src/models/Coordinator.model.ts @@ -305,10 +305,11 @@ export class Coordinator { }; getRelayUrl = (network: 'mainnet' | 'testnet', hostUrl: string, selfHosted: boolean): string => { + const protocol = hostUrl.includes('https') ? 'wss' : 'ws'; if (selfHosted && this.shortAlias !== 'local') { - return `ws://${hostUrl.replace(/^https?:\/\//, '')}/${network}/${this.shortAlias}/relay`; + return `${protocol}://${hostUrl.replace(/^https?:\/\//, '')}/${network}/${this.shortAlias}/relay/`; } else { - return `ws://${this.url.replace(/^https?:\/\//, '')}/relay`; + return `${protocol}://${this.url.replace(/^https?:\/\//, '')}/relay/`; } }; } diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index 65738fff..25f13bac 100644 --- a/frontend/src/services/RoboPool/index.ts +++ b/frontend/src/services/RoboPool/index.ts @@ -19,7 +19,8 @@ class RoboPool { ); if (settings.host) { - const hostNostr = `ws://${settings.host.replace(/^https?:\/\//, '')}/relay`; + const protocol = hostUrl.includes('https') ? 'wss' : 'ws'; + const hostNostr = `${protocol}://${settings.host.replace(/^https?:\/\//, '')}/relay/`; if (federationRelays.includes(hostNostr)) { this.relays.push(hostNostr); }