mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-08 06:46:07 -04:00
Add Port as a type
This commit is contained in:
@@ -34,7 +34,7 @@ func (request *Socks5UDPRequest) Write(buffer *alloc.Buffer) {
|
||||
case request.Address.IsDomain():
|
||||
buffer.AppendBytes(AddrTypeDomain, byte(len(request.Address.Domain()))).Append([]byte(request.Address.Domain()))
|
||||
}
|
||||
buffer.Append(request.Address.PortBytes())
|
||||
buffer.Append(request.Address.Port().Bytes())
|
||||
buffer.Append(request.Data.Value)
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ func (this *SocksServer) handleUDP(reader *v2net.TimeOutReader, writer io.Writer
|
||||
|
||||
udpAddr := this.getUDPAddr()
|
||||
|
||||
response.Port = udpAddr.Port()
|
||||
response.Port = udpAddr.Port().Value()
|
||||
switch {
|
||||
case udpAddr.IsIPv4():
|
||||
response.SetIPv4(udpAddr.IP())
|
||||
|
||||
@@ -172,7 +172,7 @@ func (this *VMessRequest) ToBytes(idHash user.CounterHash, randomRangeInt64 user
|
||||
buffer.Append(this.RequestKey)
|
||||
buffer.Append(this.ResponseHeader)
|
||||
buffer.AppendBytes(this.Command)
|
||||
buffer.Append(this.Address.PortBytes())
|
||||
buffer.Append(this.Address.Port().Bytes())
|
||||
|
||||
switch {
|
||||
case this.Address.IsIPv4():
|
||||
|
||||
Reference in New Issue
Block a user