MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / WithKeepAliveEndpoint

Function WithKeepAliveEndpoint

internal/api/server.go:131–140  ·  view source on GitHub ↗

WithKeepAliveEndpoint enables a keep-alive endpoint with the provided timeout and callback.

(timeout time.Duration, onTimeout func())

Source from the content-addressed store, hash-verified

129
130// WithKeepAliveEndpoint enables a keep-alive endpoint with the provided timeout and callback.
131func WithKeepAliveEndpoint(timeout time.Duration, onTimeout func()) ServerOption {
132 return func(cfg *serverOptionConfig) {
133 if timeout <= 0 || onTimeout == nil {
134 return
135 }
136 cfg.keepAliveEnabled = true
137 cfg.keepAliveTimeout = timeout
138 cfg.keepAliveOnTimeout = onTimeout
139 }
140}
141
142// WithRequestLoggerFactory customises request logger creation.
143func WithRequestLoggerFactory(factory func(*config.Config, string) logging.RequestLogger) ServerOption {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected