Added more logging to derp server

This commit is contained in:
Juan Font Alonso 2022-06-20 12:32:13 +02:00
parent 396c3ecdf7
commit b0b919efb0

View File

@ -30,6 +30,7 @@ type DERPServer struct {
}
func (h *Headscale) NewDERPServer() (*DERPServer, error) {
log.Trace().Caller().Msg("Creating new embedded DERP server")
server := derp.NewServer(key.NodePrivate(*h.privateKey), log.Info().Msgf)
region, err := h.generateRegionLocalDERP()
if err != nil {
@ -87,6 +88,7 @@ func (h *Headscale) generateRegionLocalDERP() (tailcfg.DERPRegion, error) {
}
localDERPregion.Nodes[0].STUNPort = portSTUN
log.Info().Caller().Msgf("DERP region: %+v", localDERPregion)
return localDERPregion, nil
}
@ -128,6 +130,7 @@ func (h *Headscale) DERPHandler(
return
}
log.Trace().Caller().Msgf("Hijacked connection from %v", r.RemoteAddr)
if !fastStart {
pubKey := h.privateKey.Public()