Skip to content
Snippets Groups Projects
Unverified Commit 45a38020 authored by Konrad Zemek's avatar Konrad Zemek Committed by GitHub
Browse files

Merge pull request #2 from onlyjob/master

codespell: spelling corrections
parents 52daf519 d1904f37
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ Usage of ./go-mmproxy: ...@@ -58,7 +58,7 @@ Usage of ./go-mmproxy:
-close-after int -close-after int
Number of seconds after which UDP socket will be cleaned up (default 60) Number of seconds after which UDP socket will be cleaned up (default 60)
-l string -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 -listeners int
Number of listener sockets that will be opened for the listen address (Linux 3.9+) (default 1) Number of listener sockets that will be opened for the listen address (Linux 3.9+) (default 1)
-mark int -mark int
...@@ -67,7 +67,7 @@ Usage of ./go-mmproxy: ...@@ -67,7 +67,7 @@ Usage of ./go-mmproxy:
Protocol that will be proxied: tcp, udp (default "tcp") Protocol that will be proxied: tcp, udp (default "tcp")
-v int -v int
0 - no logging of individual connections 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 2 - log all state changes of individual connections
``` ```
......
...@@ -35,12 +35,12 @@ var Opts options ...@@ -35,12 +35,12 @@ var Opts options
func init() { func init() {
flag.StringVar(&Opts.Protocol, "p", "tcp", "Protocol that will be proxied: tcp, udp") 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.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.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.Mark, "mark", 0, "The mark that will be set on outbound packets")
flag.IntVar(&Opts.Verbose, "v", 0, `0 - no logging of individual connections 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`) 2 - log all state changes of individual connections`)
flag.StringVar(&Opts.allowedSubnetsPath, "allowed-subnets", "", flag.StringVar(&Opts.allowedSubnetsPath, "allowed-subnets", "",
"Path to a file that contains allowed subnets of the proxy servers") "Path to a file that contains allowed subnets of the proxy servers")
......
...@@ -57,7 +57,7 @@ func tcpHandleConnection(conn net.Conn, logger *zap.Logger) { ...@@ -57,7 +57,7 @@ func tcpHandleConnection(conn net.Conn, logger *zap.Logger) {
logger = logger.With(zap.String("clientAddr", saddr.String()), zap.String("targetAddr", targetAddr)) logger = logger.With(zap.String("clientAddr", saddr.String()), zap.String("targetAddr", targetAddr))
if Opts.Verbose > 1 { if Opts.Verbose > 1 {
logger.Debug("successfuly parsed PROXY header") logger.Debug("successfully parsed PROXY header")
} }
dialer := net.Dialer{LocalAddr: saddr} dialer := net.Dialer{LocalAddr: saddr}
...@@ -72,19 +72,19 @@ func tcpHandleConnection(conn net.Conn, logger *zap.Logger) { ...@@ -72,19 +72,19 @@ func tcpHandleConnection(conn net.Conn, logger *zap.Logger) {
defer upstreamConn.Close() defer upstreamConn.Close()
if Opts.Verbose > 1 { 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 { 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)) logger.Debug("failed to set nodelay on downstream connection", zap.Error(err), zap.Bool("dropConnection", true))
} else if Opts.Verbose > 1 { } 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 { 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)) logger.Debug("failed to set nodelay on upstream connection", zap.Error(err), zap.Bool("dropConnection", true))
} else if Opts.Verbose > 1 { } 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 { for len(restBytes) > 0 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment