mirror of https://github.com/fiatjaf/nak.git
feat: use localhost relay without having to type 'ws://'
This commit is contained in:
parent
9a41450209
commit
71181a9337
4
relay.go
4
relay.go
|
@ -22,7 +22,9 @@ var relay = &cli.Command{
|
|||
return fmt.Errorf("specify the <relay-url>")
|
||||
}
|
||||
|
||||
if !strings.HasPrefix(url, "wss://") && !strings.HasPrefix(url, "ws://") {
|
||||
if strings.HasPrefix(url, "localhost") == true {
|
||||
url = "ws://" + url
|
||||
} else if !strings.HasPrefix(url, "wss://") && !strings.HasPrefix(url, "ws://") {
|
||||
url = "wss://" + url
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue