tsnet: add Server.ControlURL option

As requested in #6250 from @majst01.

Change-Id: Ia4bc5c4ebc98cd67d07328a1a42b87574261ddde
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
mihaip/logout-async-start
Brad Fitzpatrick 2 years ago committed by Brad Fitzpatrick
parent f81351fdef
commit 1950e56478

@ -84,6 +84,10 @@ type Server struct {
// used. // used.
AuthKey string AuthKey string
// ControlURL optionally specifies the coordination server URL.
// If empty, the Tailscale default is used.
ControlURL string
initOnce sync.Once initOnce sync.Once
initErr error initErr error
lb *ipnlocal.LocalBackend lb *ipnlocal.LocalBackend
@ -340,6 +344,7 @@ func (s *Server) start() (reterr error) {
prefs := ipn.NewPrefs() prefs := ipn.NewPrefs()
prefs.Hostname = s.hostname prefs.Hostname = s.hostname
prefs.WantRunning = true prefs.WantRunning = true
prefs.ControlURL = s.ControlURL
authKey := s.getAuthKey() authKey := s.getAuthKey()
err = lb.Start(ipn.Options{ err = lb.Start(ipn.Options{
UpdatePrefs: prefs, UpdatePrefs: prefs,

Loading…
Cancel
Save