Browse Source

tsnet: add Server.ControlURL option

As requested in #6250 from @majst01.

Change-Id: Ia4bc5c4ebc98cd67d07328a1a42b87574261ddde
Signed-off-by: Brad Fitzpatrick <[email protected]>
Brad Fitzpatrick 3 years ago
parent
commit
1950e56478
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tsnet/tsnet.go

+ 5 - 0
tsnet/tsnet.go

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