Add an embedded DERP server to Headscale

This series of commit will be adding an embedded DERP server (and STUN) to Headscale,
thus making it completely self-contained and not dependant in other infrastructure.
This commit is contained in:
Juan Font Alonso 2022-03-04 00:01:31 +01:00
parent ccec534e19
commit 897d480f4d
3 changed files with 235 additions and 7 deletions

View file

@ -117,6 +117,12 @@ func LoadConfig(path string) error {
}
func GetDERPConfig() headscale.DERPConfig {
if viper.GetBool("derp.embedded_derp") {
return headscale.DERPConfig{
EmbeddedDERP: true,
}
}
urlStrs := viper.GetStringSlice("derp.urls")
urls := make([]url.URL, len(urlStrs))