From 7da8e5e9ab60f054940ab6cbc6dffede053becf0 Mon Sep 17 00:00:00 2001 From: Shizun Ge Date: Tue, 16 Jan 2024 21:53:00 -0800 Subject: [PATCH] update documents about multiple ports --- README.md | 10 +++++++--- main.go | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2f2f89a..f4baa8e 100644 --- a/README.md +++ b/README.md @@ -61,14 +61,18 @@ Usage of ./endlessh-go when logging hits line file:N, emit a stack trace -log_dir string If non-empty, write log files in this directory + -log_link string + If non-empty, add symbolic links in this directory to the log files + -logbuflevel int + Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms. -logtostderr log to standard error instead of files -max_clients int Maximum number of clients (default 4096) -max_mind_db string Path to the MaxMind DB file. - -port string - SSH listening port (default "2222") + -port value + SSH listening port. You may provide multiple -port flags to listen to multiple ports. (default "2222") -prometheus_entry string Entry point for prometheus (default "metrics") -prometheus_host string @@ -76,7 +80,7 @@ Usage of ./endlessh-go -prometheus_port string The port for prometheus (default "2112") -stderrthreshold value - logs at or above this threshold go to stderr + logs at or above this threshold go to stderr (default 2) -v value log level for V logs -vmodule value diff --git a/main.go b/main.go index 7e66f7b..da6e07d 100644 --- a/main.go +++ b/main.go @@ -116,7 +116,7 @@ func main() { maxClients := flag.Int64("max_clients", 4096, "Maximum number of clients") connType := flag.String("conn_type", "tcp", "Connection type. Possible values are tcp, tcp4, tcp6") connHost := flag.String("host", "0.0.0.0", "SSH listening address") - flag.Var(&connPorts, "port", "SSH listening port") + flag.Var(&connPorts, "port", fmt.Sprintf("SSH listening port. You may provide multiple -port flags to listen to multiple ports. (default %q)", defaultPort)) prometheusEnabled := flag.Bool("enable_prometheus", false, "Enable prometheus") prometheusHost := flag.String("prometheus_host", "0.0.0.0", "The address for prometheus") prometheusPort := flag.String("prometheus_port", "2112", "The port for prometheus")