mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-29 19:21:57 +08:00
mv session to constant
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/xjasonlyu/tun2socks/common/pool"
|
||||
"github.com/xjasonlyu/tun2socks/component/dns"
|
||||
"github.com/xjasonlyu/tun2socks/component/stats"
|
||||
C "github.com/xjasonlyu/tun2socks/constant"
|
||||
"github.com/xjasonlyu/tun2socks/core"
|
||||
"github.com/xjasonlyu/tun2socks/log"
|
||||
)
|
||||
@@ -104,7 +105,7 @@ func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error {
|
||||
// Get name of the process.
|
||||
var process = lsof.GetProcessName(localConn.LocalAddr())
|
||||
if h.sessionStater != nil {
|
||||
sess := &stats.Session{
|
||||
sess := &C.Session{
|
||||
Process: process,
|
||||
Network: localConn.LocalAddr().Network(),
|
||||
DialerAddr: remoteConn.LocalAddr().String(),
|
||||
@@ -116,7 +117,7 @@ func (h *tcpHandler) Handle(conn net.Conn, target *net.TCPAddr) error {
|
||||
}
|
||||
h.sessionStater.AddSession(localConn, sess)
|
||||
|
||||
remoteConn = stats.NewSessionConn(remoteConn, sess)
|
||||
remoteConn = C.NewSessionConn(remoteConn, sess)
|
||||
}
|
||||
|
||||
// Set keepalive
|
||||
|
||||
Reference in New Issue
Block a user