planetary-social / nos

nos.social social media for all of us, using nostr
https://nos.social
Mozilla Public License 2.0
119 stars 14 forks source link

Hide wss:// in relay list / editing #1401

Closed rabble closed 5 hours ago

rabble commented 1 month ago

Describe the bug

All relays are wss or ws and so we should hide that part of the url the way browsers hide the http until you copy it.

To Reproduce

Steps to reproduce the behavior:

  1. Go to to the relay list
  2. Tap text area to add a new relay
  3. Enter relay without wss://
  4. See relay list displayed jsut domains not wss:// or ws:// part

Expected behavior

Able to add and view relays without displaying the wss:// part

lingoslinger commented 4 weeks ago

@joshuatbrown I would like to take a stab at this one if no one else minds...

joshuatbrown commented 3 weeks ago

I do have one concern about this: if we decide to support insecure relays (ws://) in the future for local development (with something like nak which now supports running a local server), there's no way to show the full relay URL. Maybe this is something devs will just have to deal with, or maybe it's something to deal with later if/when we allow ws:// relays.

lingoslinger commented 3 weeks ago

Removing ws:// is simple enough but it looks like adding an insecure relay would involve diving into existing error logic. Let me know if we decide that the insecure server support should be handled now or later.

joshuatbrown commented 3 weeks ago

@lingoslinger don't worry about it now; I just wanted to point it out for later. Thanks again for working on this!