Update logs.

This commit is contained in:
Amin.MasterkinG
2026-04-20 14:10:10 +03:30
parent cddd7bbd54
commit 95f9fb7470
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -26,6 +26,8 @@ func main() {
logger.Fatalf("<red>load config: <cyan>%v</cyan></red>", err)
}
logger = lg.New("MasterHttpRelayVPN Client", cfg.LogLevel)
app := client.New(cfg, logger)
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
+1 -1
View File
@@ -258,7 +258,7 @@ func (c *Client) captureInitialPayload(ctx context.Context, conn net.Conn, sessi
session.InitialPayload = append([]byte(nil), buf[:n]...)
session.BytesCaptured += n
session.LastActivityAt = time.Now()
c.log.Infof(
c.log.Debugf(
"<green>session=<cyan>%d</cyan> captured initial payload bytes=<cyan>%d</cyan> target=<cyan>%s</cyan></green>",
session.ID, n, net.JoinHostPort(session.TargetHost, strconv.Itoa(int(session.TargetPort))),
)
+4
View File
@@ -22,12 +22,14 @@ type Config struct {
SOCKSAuth bool
SOCKSUsername string
SOCKSPassword string
LogLevel string
}
func Load(path string) (Config, error) {
cfg := Config{
SOCKSHost: "127.0.0.1",
SOCKSPort: 1080,
LogLevel: "INFO",
}
file, err := os.Open(path)
@@ -72,6 +74,8 @@ func Load(path string) (Config, error) {
cfg.SOCKSUsername = trimString(value)
case "SOCKS_PASSWORD":
cfg.SOCKSPassword = trimString(value)
case "LOG_LEVEL":
cfg.LogLevel = trimString(value)
}
}