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

Method enableKeepAlive

internal/api/server.go:903–917  ·  view source on GitHub ↗
(timeout time.Duration, onTimeout func())

Source from the content-addressed store, hash-verified

901}
902
903func (s *Server) enableKeepAlive(timeout time.Duration, onTimeout func()) {
904 if timeout <= 0 || onTimeout == nil {
905 return
906 }
907
908 s.keepAliveEnabled = true
909 s.keepAliveTimeout = timeout
910 s.keepAliveOnTimeout = onTimeout
911 s.keepAliveHeartbeat = make(chan struct{}, 1)
912 s.keepAliveStop = make(chan struct{}, 1)
913
914 s.engine.GET("/keep-alive", s.handleKeepAlive)
915
916 go s.watchKeepAlive()
917}
918
919func (s *Server) handleKeepAlive(c *gin.Context) {
920 if s.localPassword != "" {

Callers 1

NewServerFunction · 0.95

Calls 1

watchKeepAliveMethod · 0.95

Tested by

no test coverage detected