mirror of https://github.com/v2ray/v2ray-core
allow partial override in freedom
parent
9a8488074e
commit
b9db4514e2
|
@ -70,10 +70,11 @@ func (h *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia
|
||||||
destination, _ := proxy.TargetFromContext(ctx)
|
destination, _ := proxy.TargetFromContext(ctx)
|
||||||
if h.config.DestinationOverride != nil {
|
if h.config.DestinationOverride != nil {
|
||||||
server := h.config.DestinationOverride.Server
|
server := h.config.DestinationOverride.Server
|
||||||
destination = net.Destination{
|
if server.Address != nil {
|
||||||
Network: destination.Network,
|
destination.Address = server.Address.AsAddress()
|
||||||
Address: server.Address.AsAddress(),
|
}
|
||||||
Port: net.Port(server.Port),
|
if server.Port != 0 {
|
||||||
|
destination.Port = net.Port(server.Port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newError("opening connection to ", destination).WriteToLog(session.ExportIDToError(ctx))
|
newError("opening connection to ", destination).WriteToLog(session.ExportIDToError(ctx))
|
||||||
|
|
Loading…
Reference in New Issue