From 8297fe9544b641c479b5288e4d5e5f1957483810 Mon Sep 17 00:00:00 2001 From: Hubert Grochowski Date: Mon, 11 Sep 2023 16:57:16 +0200 Subject: [PATCH] bind: add read and write limit --- bind/flag.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bind/flag.go b/bind/flag.go index 4be5c33a..e8e03ff7 100644 --- a/bind/flag.go +++ b/bind/flag.go @@ -120,6 +120,14 @@ func HTTPProxyConfig(fs *pflag.FlagSet, cfg *forwarder.HTTPProxyConfig, lcfg *lo ""+ "If the header is present in the request, "+ "the proxy will associate the value with the request in the logs. ") + + fs.Var(&cfg.ReadLimit, "read-limit", ""+ + "Global read rate limit in bytes per second i.e. how many bytes per second you can receive from a proxy. "+ + "Accepts binary format (e.g. 1.5Ki, 1Mi, 3.6Gi). ") + + fs.Var(&cfg.WriteLimit, "write-limit", ""+ + "Global write rate limit in bytes per second i.e. how many bytes per second you can send to proxy. "+ + "Accepts binary format (e.g. 1.5Ki, 1Mi, 3.6Gi). ") } func DenyDomains(fs *pflag.FlagSet, cfg *[]ruleset.RegexpListItem) {