添加在线调试 api

This commit is contained in:
2025-03-08 10:59:31 +08:00
parent 053041ae34
commit 5786ac9d99
28 changed files with 236 additions and 539 deletions

View File

@@ -7,6 +7,7 @@ import (
"proxy-server/pkg/utils"
"proxy-server/server/fwd/core"
"proxy-server/server/fwd/http"
"proxy-server/server/fwd/metrics"
"proxy-server/server/fwd/socks"
"strconv"
"strings"
@@ -112,6 +113,8 @@ func (s *Server) acceptHttp(ls net.Listener) error {
return errors.Wrap(err, "dispatcher http accept error")
}
metrics.TimerStart.Store(conn, time.Now())
go func() {
user, err := http.Process(s.ctx, conn)
if err != nil {
@@ -142,6 +145,8 @@ func (s *Server) acceptSocks(ls net.Listener) error {
return errors.Wrap(err, "dispatcher socks accept error")
}
metrics.TimerStart.Store(conn, time.Now())
go func() {
user, err := socks.Process(s.ctx, conn)
if err != nil {