feat: use localhost relay without having to type 'ws://'

This commit is contained in:
P. Reis 2024-07-03 21:14:58 -03:00
parent 9a41450209
commit 71181a9337
1 changed files with 3 additions and 1 deletions

View File

@ -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
}