1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

allow partial override in freedom

This commit is contained in:
Darien Raymond 2018-07-18 16:21:40 +02:00
parent 9a8488074e
commit b9db4514e2
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -70,10 +70,11 @@ func (h *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia
destination, _ := proxy.TargetFromContext(ctx)
if h.config.DestinationOverride != nil {
server := h.config.DestinationOverride.Server
destination = net.Destination{
Network: destination.Network,
Address: server.Address.AsAddress(),
Port: net.Port(server.Port),
if server.Address != nil {
destination.Address = server.Address.AsAddress()
}
if server.Port != 0 {
destination.Port = net.Port(server.Port)
}
}
newError("opening connection to ", destination).WriteToLog(session.ExportIDToError(ctx))