diff --git a/README.md b/README.md index 11e17006f099604f130183d474dc9729aac2bf57..da89b612450d7525a6d8a9e72070d46786dc67c5 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Usage of ./go-mmproxy: -close-after int Number of seconds after which UDP socket will be cleaned up (default 60) -l string - Adress the proxy listens on (default "0.0.0.0:8443") + Address the proxy listens on (default "0.0.0.0:8443") -listeners int Number of listener sockets that will be opened for the listen address (Linux 3.9+) (default 1) -mark int @@ -67,7 +67,7 @@ Usage of ./go-mmproxy: Protocol that will be proxied: tcp, udp (default "tcp") -v int 0 - no logging of individual connections - 1 - log errors occuring in individual connections + 1 - log errors occurring in individual connections 2 - log all state changes of individual connections ``` diff --git a/main.go b/main.go index 36a5e46487bfbed4927284bc2de2c8b95f080c6d..395f4644b41b8259bb340d7b0b58316c015a3f9a 100644 --- a/main.go +++ b/main.go @@ -35,12 +35,12 @@ var Opts options func init() { flag.StringVar(&Opts.Protocol, "p", "tcp", "Protocol that will be proxied: tcp, udp") - flag.StringVar(&Opts.ListenAddr, "l", "0.0.0.0:8443", "Adress the proxy listens on") + flag.StringVar(&Opts.ListenAddr, "l", "0.0.0.0:8443", "Address the proxy listens on") flag.StringVar(&Opts.TargetAddr4, "4", "127.0.0.1:443", "Address to which IPv4 traffic will be forwarded to") flag.StringVar(&Opts.TargetAddr6, "6", "[::1]:443", "Address to which IPv6 traffic will be forwarded to") flag.IntVar(&Opts.Mark, "mark", 0, "The mark that will be set on outbound packets") flag.IntVar(&Opts.Verbose, "v", 0, `0 - no logging of individual connections -1 - log errors occuring in individual connections +1 - log errors occurring in individual connections 2 - log all state changes of individual connections`) flag.StringVar(&Opts.allowedSubnetsPath, "allowed-subnets", "", "Path to a file that contains allowed subnets of the proxy servers") diff --git a/tcp.go b/tcp.go index 3c79fabba768b163fc589551e69249fee5f0394c..5335e0702d09eb8aa58e848904d2586eb4567119 100644 --- a/tcp.go +++ b/tcp.go @@ -57,7 +57,7 @@ func tcpHandleConnection(conn net.Conn, logger *zap.Logger) { logger = logger.With(zap.String("clientAddr", saddr.String()), zap.String("targetAddr", targetAddr)) if Opts.Verbose > 1 { - logger.Debug("successfuly parsed PROXY header") + logger.Debug("successfully parsed PROXY header") } dialer := net.Dialer{LocalAddr: saddr} @@ -72,19 +72,19 @@ func tcpHandleConnection(conn net.Conn, logger *zap.Logger) { defer upstreamConn.Close() if Opts.Verbose > 1 { - logger.Debug("successfuly established upstream connection") + logger.Debug("successfully established upstream connection") } if err := conn.(*net.TCPConn).SetNoDelay(true); err != nil { logger.Debug("failed to set nodelay on downstream connection", zap.Error(err), zap.Bool("dropConnection", true)) } else if Opts.Verbose > 1 { - logger.Debug("successfuly set NoDelay on downstream connection") + logger.Debug("successfully set NoDelay on downstream connection") } if err := upstreamConn.(*net.TCPConn).SetNoDelay(true); err != nil { logger.Debug("failed to set nodelay on upstream connection", zap.Error(err), zap.Bool("dropConnection", true)) } else if Opts.Verbose > 1 { - logger.Debug("successfuly set NoDelay on upstream connection") + logger.Debug("successfully set NoDelay on upstream connection") } for len(restBytes) > 0 {