1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 20:45:28 -05:00

update context functions

This commit is contained in:
Darien Raymond
2017-02-09 22:49:38 +01:00
parent d270a99d4f
commit d04d92c187
15 changed files with 122 additions and 98 deletions

View File

@@ -70,7 +70,11 @@ func (v *Router) TakeDetour(ctx context.Context) (string, error) {
}
}
dest := proxy.DestinationFromContext(ctx)
dest, ok := proxy.TargetFromContext(ctx)
if !ok {
return "", ErrNoRuleApplicable
}
if v.domainStrategy == Config_IpIfNonMatch && dest.Address.Family().IsDomain() {
log.Info("Router: Looking up IP for ", dest)
ipDests := v.resolveIP(dest)