fix url parsing
This commit is contained in:
parent
87c44b29ea
commit
6a81d2f348
@ -97,9 +97,18 @@ Type a message and press Enter to send.`)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
port := parsedUrl.Port()
|
||||
if parsedUrl.Scheme == "https" {
|
||||
transportCredential = credentials.NewTLS(&tls.Config{})
|
||||
}
|
||||
if port == "" {
|
||||
switch parsedUrl.Scheme {
|
||||
case "https":
|
||||
port = "443"
|
||||
default:
|
||||
port = "80"
|
||||
}
|
||||
}
|
||||
|
||||
client := &SignalClient{
|
||||
UI: SignalClientUI{
|
||||
@ -115,7 +124,7 @@ Type a message and press Enter to send.`)
|
||||
},
|
||||
},
|
||||
|
||||
Server: fmt.Sprintf("%v:%v", parsedUrl.Hostname(), parsedUrl.Port()),
|
||||
Server: fmt.Sprintf("%v:%v", parsedUrl.Hostname(), port),
|
||||
Credential: transportCredential,
|
||||
|
||||
Room: room,
|
||||
|
Loading…
x
Reference in New Issue
Block a user