mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-19 17:23:19 +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 => {
|
||||
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/`;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user