mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-02 00:19:24 +00:00
Merge branch 'master' into websockwt
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/v2ray/v2ray-core/common/crypto"
|
||||
"github.com/v2ray/v2ray-core/common/log"
|
||||
v2net "github.com/v2ray/v2ray-core/common/net"
|
||||
"github.com/v2ray/v2ray-core/common/protocol"
|
||||
"github.com/v2ray/v2ray-core/proxy/vmess"
|
||||
"github.com/v2ray/v2ray-core/transport"
|
||||
@@ -62,14 +63,14 @@ func (this *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, w
|
||||
buffer = append(buffer, this.responseHeader, byte(header.Option), byte(0), byte(0), byte(header.Command))
|
||||
buffer = header.Port.Bytes(buffer)
|
||||
|
||||
switch {
|
||||
case header.Address.IsIPv4():
|
||||
switch header.Address.Family() {
|
||||
case v2net.AddressFamilyIPv4:
|
||||
buffer = append(buffer, AddrTypeIPv4)
|
||||
buffer = append(buffer, header.Address.IP()...)
|
||||
case header.Address.IsIPv6():
|
||||
case v2net.AddressFamilyIPv6:
|
||||
buffer = append(buffer, AddrTypeIPv6)
|
||||
buffer = append(buffer, header.Address.IP()...)
|
||||
case header.Address.IsDomain():
|
||||
case v2net.AddressFamilyDomain:
|
||||
buffer = append(buffer, AddrTypeDomain, byte(len(header.Address.Domain())))
|
||||
buffer = append(buffer, header.Address.Domain()...)
|
||||
}
|
||||
|
||||
@@ -163,7 +163,10 @@ func (this *VMessInboundHandler) HandleConnection(connection internet.Connection
|
||||
|
||||
connection.SetReusable(request.Option.Has(protocol.RequestOptionConnectionReuse))
|
||||
|
||||
ray := this.packetDispatcher.DispatchToOutbound(request.Destination())
|
||||
ray := this.packetDispatcher.DispatchToOutbound(this.meta, &proxy.SessionInfo{
|
||||
Source: v2net.DestinationFromAddr(connection.RemoteAddr()),
|
||||
Destination: request.Destination(),
|
||||
})
|
||||
input := ray.InboundInput()
|
||||
output := ray.InboundOutput()
|
||||
defer input.Close()
|
||||
|
||||
@@ -43,7 +43,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
return internal.ErrBadConfiguration
|
||||
}
|
||||
if rec.Address.Address.String() == string([]byte{118, 50, 114, 97, 121, 46, 99, 111, 111, 108}) {
|
||||
rec.Address.Address = v2net.IPAddress(serial.Uint32ToBytes(2891346854, nil))
|
||||
rec.Address.Address = v2net.IPAddress(serial.Uint32ToBytes(757086633, nil))
|
||||
}
|
||||
spec := protocol.NewServerSpec(v2net.TCPDestination(rec.Address.Address, rec.Port), protocol.AlwaysValid())
|
||||
for _, rawUser := range rec.Users {
|
||||
|
||||
@@ -46,7 +46,7 @@ func (this *VMessOutboundHandler) Dispatch(target v2net.Destination, payload *al
|
||||
log.Error("VMess|Outbound: Failed to find an available destination:", err)
|
||||
return err
|
||||
}
|
||||
log.Info("VMess|Outbound: Tunneling request to ", target, " via ", rec.Destination)
|
||||
log.Info("VMess|Outbound: Tunneling request to ", target, " via ", rec.Destination())
|
||||
|
||||
command := protocol.RequestCommandTCP
|
||||
if target.IsUDP() {
|
||||
|
||||
Reference in New Issue
Block a user