|
|
@ -76,6 +76,7 @@ type Direct struct {
|
|
|
|
pinger Pinger
|
|
|
|
pinger Pinger
|
|
|
|
popBrowser func(url string) // or nil
|
|
|
|
popBrowser func(url string) // or nil
|
|
|
|
c2nHandler http.Handler // or nil
|
|
|
|
c2nHandler http.Handler // or nil
|
|
|
|
|
|
|
|
onClientVersion func(*tailcfg.ClientVersion) // or nil
|
|
|
|
|
|
|
|
|
|
|
|
dialPlan ControlDialPlanner // can be nil
|
|
|
|
dialPlan ControlDialPlanner // can be nil
|
|
|
|
|
|
|
|
|
|
|
@ -114,6 +115,7 @@ type Options struct {
|
|
|
|
DebugFlags []string // debug settings to send to control
|
|
|
|
DebugFlags []string // debug settings to send to control
|
|
|
|
LinkMonitor *monitor.Mon // optional link monitor
|
|
|
|
LinkMonitor *monitor.Mon // optional link monitor
|
|
|
|
PopBrowserURL func(url string) // optional func to open browser
|
|
|
|
PopBrowserURL func(url string) // optional func to open browser
|
|
|
|
|
|
|
|
OnClientVersion func(*tailcfg.ClientVersion) // optional func to inform GUI of client version status
|
|
|
|
Dialer *tsdial.Dialer // non-nil
|
|
|
|
Dialer *tsdial.Dialer // non-nil
|
|
|
|
C2NHandler http.Handler // or nil
|
|
|
|
C2NHandler http.Handler // or nil
|
|
|
|
|
|
|
|
|
|
|
@ -241,6 +243,7 @@ func NewDirect(opts Options) (*Direct, error) {
|
|
|
|
skipIPForwardingCheck: opts.SkipIPForwardingCheck,
|
|
|
|
skipIPForwardingCheck: opts.SkipIPForwardingCheck,
|
|
|
|
pinger: opts.Pinger,
|
|
|
|
pinger: opts.Pinger,
|
|
|
|
popBrowser: opts.PopBrowserURL,
|
|
|
|
popBrowser: opts.PopBrowserURL,
|
|
|
|
|
|
|
|
onClientVersion: opts.OnClientVersion,
|
|
|
|
c2nHandler: opts.C2NHandler,
|
|
|
|
c2nHandler: opts.C2NHandler,
|
|
|
|
dialer: opts.Dialer,
|
|
|
|
dialer: opts.Dialer,
|
|
|
|
dialPlan: opts.DialPlan,
|
|
|
|
dialPlan: opts.DialPlan,
|
|
|
@ -1008,6 +1011,9 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, readOnly bool
|
|
|
|
c.logf("netmap: control says to open URL %v; no popBrowser func", u)
|
|
|
|
c.logf("netmap: control says to open URL %v; no popBrowser func", u)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if resp.ClientVersion != nil && c.onClientVersion != nil {
|
|
|
|
|
|
|
|
c.onClientVersion(resp.ClientVersion)
|
|
|
|
|
|
|
|
}
|
|
|
|
if resp.ControlTime != nil && !resp.ControlTime.IsZero() {
|
|
|
|
if resp.ControlTime != nil && !resp.ControlTime.IsZero() {
|
|
|
|
c.logf.JSON(1, "controltime", resp.ControlTime.UTC())
|
|
|
|
c.logf.JSON(1, "controltime", resp.ControlTime.UTC())
|
|
|
|
}
|
|
|
|
}
|
|
|
|