init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package parseurl
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParseTGProxy(t *testing.T) {
|
||||
raw := "tg://proxy?server=example.com&port=443&secret=ee0102030405060708090a0b0c0d0e0f10632e6578616d706c652e636f6d"
|
||||
tg, err := ParseTGProxy(raw)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if tg.Host != "example.com" || tg.Port != 443 {
|
||||
t.Fatalf("%+v", tg)
|
||||
}
|
||||
if tg.Secret == "" {
|
||||
t.Fatal("secret")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user