1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-10-28 03:54:04 -04:00

prefer interface over struct

This commit is contained in:
V2Ray
2015-09-20 18:22:29 +02:00
parent 823cbf1509
commit cb16047cf0
12 changed files with 88 additions and 59 deletions

View File

@@ -278,7 +278,7 @@ func ReadRequest(reader io.Reader) (request *Socks5Request, err error) {
return
}
func (request *Socks5Request) Destination() *v2net.Destination {
func (request *Socks5Request) Destination() v2net.Destination {
var address v2net.Address
switch request.AddrType {
case AddrTypeIPv4:
@@ -290,7 +290,7 @@ func (request *Socks5Request) Destination() *v2net.Destination {
default:
panic("Unknown address type")
}
return v2net.NewDestination(v2net.NetTCP, address)
return v2net.NewTCPDestination(address)
}
const (