mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
22 lines
310 B
Go
22 lines
310 B
Go
|
package socks5
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"golang.org/x/net/context"
|
||
|
)
|
||
|
|
||
|
func TestDNSResolver(t *testing.T) {
|
||
|
d := DNSResolver{}
|
||
|
ctx := context.Background()
|
||
|
|
||
|
_, addr, err := d.Resolve(ctx, "localhost")
|
||
|
if err != nil {
|
||
|
t.Fatalf("err: %v", err)
|
||
|
}
|
||
|
|
||
|
if !addr.IsLoopback() {
|
||
|
t.Fatalf("expected loopback")
|
||
|
}
|
||
|
}
|