mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:44:03 +03:00
Fix for urls
This commit is contained in:
+5
-3
@@ -2,8 +2,9 @@ package config
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type URLs struct {
|
type URLs struct {
|
||||||
@@ -35,9 +36,10 @@ func GetURLs() (urls IPURLs) {
|
|||||||
return urls
|
return urls
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeURLs(addr fmt.Stringer, secret string) (urls URLs) {
|
func makeURLs(addr *net.TCPAddr, secret string) (urls URLs) {
|
||||||
values := url.Values{}
|
values := url.Values{}
|
||||||
values.Set("address", addr.String())
|
values.Set("server", addr.IP.String())
|
||||||
|
values.Set("port", strconv.Itoa(addr.Port))
|
||||||
values.Set("secret", secret)
|
values.Set("secret", secret)
|
||||||
|
|
||||||
urls.TG = makeTGURL(values)
|
urls.TG = makeTGURL(values)
|
||||||
|
|||||||
Reference in New Issue
Block a user