mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-18 16:53:16 +00:00
Check protocol
This commit is contained in:
@ -305,10 +305,11 @@ export class Coordinator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getRelayUrl = (network: 'mainnet' | 'testnet', hostUrl: string, selfHosted: boolean): string => {
|
getRelayUrl = (network: 'mainnet' | 'testnet', hostUrl: string, selfHosted: boolean): string => {
|
||||||
|
const protocol = hostUrl.includes('https') ? 'wss' : 'ws';
|
||||||
if (selfHosted && this.shortAlias !== 'local') {
|
if (selfHosted && this.shortAlias !== 'local') {
|
||||||
return `ws://${hostUrl.replace(/^https?:\/\//, '')}/${network}/${this.shortAlias}/relay/`;
|
return `${protocol}://${hostUrl.replace(/^https?:\/\//, '')}/${network}/${this.shortAlias}/relay/`;
|
||||||
} else {
|
} else {
|
||||||
return `ws://${this.url.replace(/^https?:\/\//, '')}/relay/`;
|
return `${protocol}://${this.url.replace(/^https?:\/\//, '')}/relay/`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user