1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-10-09 10:34:03 -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

@@ -13,7 +13,6 @@ import (
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/proxy"
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/pipe"
)
@@ -65,8 +64,8 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
Port: d.port,
}
if d.config.FollowRedirect {
if origDest, ok := proxy.OriginalTargetFromContext(ctx); ok {
dest = origDest
if outbound := session.OutboundFromContext(ctx); outbound != nil && outbound.Target.IsValid() {
dest = outbound.Target
} else if handshake, ok := conn.(hasHandshakeAddress); ok {
addr := handshake.HandshakeAddress()
if addr != nil {
@@ -117,7 +116,7 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
Tproxy: internet.SocketConfig_TProxy,
},
})
tConn, err := internet.DialSystem(tCtx, nil, net.DestinationFromAddr(conn.RemoteAddr()))
tConn, err := internet.DialSystem(tCtx, net.DestinationFromAddr(conn.RemoteAddr()))
if err != nil {
return err
}