feat: add option to disable filtering for onion relays
This commit is contained in:
parent
606f9af1ba
commit
5ba5c26fcd
25 changed files with 98 additions and 36 deletions
|
|
@ -2,6 +2,15 @@ export function isWebsocketUrl(url: string): boolean {
|
|||
return /^wss?:\/\/.+$/.test(url)
|
||||
}
|
||||
|
||||
export function isOnionUrl(url: string): boolean {
|
||||
try {
|
||||
const hostname = new URL(url).hostname
|
||||
return hostname.endsWith('.onion')
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// copy from nostr-tools/utils
|
||||
export function normalizeUrl(url: string): string {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue