From ffeafa4d2e00d583e50f8a76601ba630ab9a89fa Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Tue, 8 Feb 2022 12:07:26 +0200 Subject: [PATCH] aperture: hashmail keepalive enforcement policy Lower the MinTime frequency that the client is allowed to send pings to 1 min instead of the default of 5 mins. --- aperture.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aperture.go b/aperture.go index 68169c5..00dad6a 100644 --- a/aperture.go +++ b/aperture.go @@ -35,6 +35,7 @@ import ( "golang.org/x/net/http2/h2c" "google.golang.org/grpc" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" "google.golang.org/protobuf/encoding/protojson" "gopkg.in/yaml.v2" ) @@ -695,6 +696,9 @@ func createHashMailServer(cfg *Config) ([]proxy.LocalService, func(), error) { grpc.ChainStreamInterceptor( grpc_prometheus.StreamServerInterceptor, ), + grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{ + MinTime: time.Minute, + }), } // Create a gRPC server for the hashmail server.