kernl API
    Preparing search index...

    Function toRelayUrl

    • A server URL in its normalised form, when it is one. Only ws: and wss: count: applesauce's normaliser would turn https:// or a bare word into a server address, and NIP-66 lets a report name a server by pubkey.

      Parameters

      • url: string

        A server URL as written anywhere.

      Returns string | undefined

      The normalised URL, or undefined.

      toRelayUrl('wss://Relay.Example'); // 'wss://relay.example/'
      toRelayUrl('https://relay.example'); // undefined