1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-19 12:09:10 -04:00

move session based info into session package

This commit is contained in:
Darien Raymond
2018-09-18 23:09:54 +02:00
parent f589769947
commit 94b880d060
28 changed files with 212 additions and 194 deletions

View File

@@ -76,7 +76,11 @@ func isValidAddress(addr *net.IPOrDomain) bool {
// Process implements proxy.Outbound.
func (h *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dialer) error {
destination, _ := proxy.TargetFromContext(ctx)
outbound := session.OutboundFromContext(ctx)
if outbound == nil || !outbound.Target.IsValid() {
return newError("target not specified.")
}
destination := outbound.Target
if h.config.DestinationOverride != nil {
server := h.config.DestinationOverride.Server
if isValidAddress(server.Address) {