mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
Added more logging to derp server
This commit is contained in:
parent
396c3ecdf7
commit
b0b919efb0
1 changed files with 3 additions and 0 deletions
|
@ -30,6 +30,7 @@ type DERPServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Headscale) NewDERPServer() (*DERPServer, error) {
|
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)
|
server := derp.NewServer(key.NodePrivate(*h.privateKey), log.Info().Msgf)
|
||||||
region, err := h.generateRegionLocalDERP()
|
region, err := h.generateRegionLocalDERP()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -87,6 +88,7 @@ func (h *Headscale) generateRegionLocalDERP() (tailcfg.DERPRegion, error) {
|
||||||
}
|
}
|
||||||
localDERPregion.Nodes[0].STUNPort = portSTUN
|
localDERPregion.Nodes[0].STUNPort = portSTUN
|
||||||
|
|
||||||
|
log.Info().Caller().Msgf("DERP region: %+v", localDERPregion)
|
||||||
return localDERPregion, nil
|
return localDERPregion, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +130,7 @@ func (h *Headscale) DERPHandler(
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.Trace().Caller().Msgf("Hijacked connection from %v", r.RemoteAddr)
|
||||||
|
|
||||||
if !fastStart {
|
if !fastStart {
|
||||||
pubKey := h.privateKey.Public()
|
pubKey := h.privateKey.Public()
|
||||||
|
|
Loading…
Reference in a new issue