github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/net/proxy/socks5/tools/tools_test.go (about)

     1  package tools
     2  
     3  import (
     4  	"bytes"
     5  	"testing"
     6  
     7  	"github.com/Asutorufa/yuhaiin/pkg/net/netapi"
     8  	"github.com/Asutorufa/yuhaiin/pkg/utils/assert"
     9  )
    10  
    11  func TestResolveAddr(t *testing.T) {
    12  	z := ParseAddr(netapi.ParseAddressPort(0, "a.com", netapi.ParsePort(51)))
    13  	t.Log(z.Bytes.Bytes())
    14  
    15  	addr, err := ResolveAddr(bytes.NewReader(z.Bytes.Bytes()))
    16  	assert.NoError(t, err)
    17  	t.Log(addr.Bytes.Bytes())
    18  	t.Log(addr.Address(0))
    19  }