From 5fd075830822130e4ff77196171139e821819fbf Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 20 May 2025 11:54:35 +0200 Subject: [PATCH 1/3] Fix relay conection --- frontend/src/models/Coordinator.model.ts | 4 ++-- frontend/src/services/RoboPool/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/models/Coordinator.model.ts b/frontend/src/models/Coordinator.model.ts index 3ae5e6b8..f863523b 100644 --- a/frontend/src/models/Coordinator.model.ts +++ b/frontend/src/models/Coordinator.model.ts @@ -306,9 +306,9 @@ export class Coordinator { getRelayUrl = (network: 'mainnet' | 'testnet', hostUrl: string, selfHosted: boolean): string => { if (selfHosted && this.shortAlias !== 'local') { - return `ws://${hostUrl.replace(/^https?:\/\//, '')}/${network}/${this.shortAlias}/relay`; + return `ws://${hostUrl.replace(/^https?:\/\//, '')}/${network}/${this.shortAlias}/relay/`; } else { - return `ws://${this.url.replace(/^https?:\/\//, '')}/relay`; + return `ws://${this.url.replace(/^https?:\/\//, '')}/relay/`; } }; } diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index 65738fff..c255da59 100644 --- a/frontend/src/services/RoboPool/index.ts +++ b/frontend/src/services/RoboPool/index.ts @@ -19,7 +19,7 @@ class RoboPool { ); if (settings.host) { - const hostNostr = `ws://${settings.host.replace(/^https?:\/\//, '')}/relay`; + const hostNostr = `ws://${settings.host.replace(/^https?:\/\//, '')}/relay/`; if (federationRelays.includes(hostNostr)) { this.relays.push(hostNostr); } From ac0c489da28276ef3db798bae68bfd2d4defaed5 Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 20 May 2025 14:06:24 +0200 Subject: [PATCH 2/3] Check protocol --- frontend/src/models/Coordinator.model.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/models/Coordinator.model.ts b/frontend/src/models/Coordinator.model.ts index f863523b..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/`; } }; } From d2a1a74a1cdfc9003f9d23f492954810dca0429e Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 20 May 2025 14:07:37 +0200 Subject: [PATCH 3/3] Check protocol --- frontend/src/services/RoboPool/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index c255da59..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); }