Feat: healthcheck uses ping instead of DNS

This commit is contained in:
Quentin McGaw (desktop)
2021-09-11 21:49:46 +00:00
parent 0eccd068e5
commit 541a4a3271
8 changed files with 215 additions and 27 deletions

View File

@@ -2,7 +2,6 @@ package healthcheck
import (
"context"
"net"
"github.com/qdm12/gluetun/internal/configuration"
"github.com/qdm12/gluetun/internal/vpn"
@@ -16,20 +15,20 @@ type ServerRunner interface {
}
type Server struct {
logger logging.Logger
handler *handler
resolver *net.Resolver
config configuration.Health
vpn vpnHealth
logger logging.Logger
handler *handler
pinger Pinger
config configuration.Health
vpn vpnHealth
}
func NewServer(config configuration.Health,
logger logging.Logger, vpnLooper vpn.Looper) *Server {
return &Server{
logger: logger,
handler: newHandler(logger),
resolver: net.DefaultResolver,
config: config,
logger: logger,
handler: newHandler(logger),
pinger: newPinger(),
config: config,
vpn: vpnHealth{
looper: vpnLooper,
healthyWait: config.VPN.Initial,