dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit 8ab11ea53ec5d48c280908f56f445e9a70d5621f
parent b30cb6b12f12d17522465241e1d27f2f913ed4ec
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed, 11 Jan 2023 15:23:49 -0800

cleanup

Diffstat:
Mpkg/web/web.go | 9+++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/pkg/web/web.go b/pkg/web/web.go @@ -306,9 +306,7 @@ func startI2pServer(host string, port int) { func startTorServer(host string, port int) { address := host + ":" + strconv.Itoa(port) e := getBaseServer() - if config.Development.IsFalse() { - prodServer(e) - } + configTorProdServer(e) logrus.Info("start tor server on " + address) if err := e.Start(address); err != nil { if err != http.ErrServerClosed { @@ -340,7 +338,10 @@ func extractGlobalCircuitIdentifier(m string) int64 { return globalCircuitID } -func prodServer(e *echo.Echo) { +func configTorProdServer(e *echo.Echo) { + if config.Development.IsTrue() { + return + } rate := limiter.Rate{Period: 5 * time.Second, Limit: 25} store := memory.NewStore() limiterInstance := limiter.New(store, rate)