mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add a dns.OSConfigurator implementation that uses the CoderVPN protocol (#15342)
Closes #14733.
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/ipn/ipnstate"
|
||||
"tailscale.com/net/connstats"
|
||||
"tailscale.com/net/dns"
|
||||
"tailscale.com/net/netmon"
|
||||
"tailscale.com/net/netns"
|
||||
"tailscale.com/net/tsdial"
|
||||
@@ -106,6 +107,9 @@ type Options struct {
|
||||
ClientType proto.TelemetryEvent_ClientType
|
||||
// TelemetrySink is optional.
|
||||
TelemetrySink TelemetrySink
|
||||
// DNSConfigurator is optional, and is passed to the underlying wireguard
|
||||
// engine.
|
||||
DNSConfigurator dns.OSConfigurator
|
||||
}
|
||||
|
||||
// TelemetrySink allows tailnet.Conn to send network telemetry to the Coder
|
||||
@@ -178,6 +182,7 @@ func NewConn(options *Options) (conn *Conn, err error) {
|
||||
Dialer: dialer,
|
||||
ListenPort: options.ListenPort,
|
||||
SetSubsystem: sys.Set,
|
||||
DNS: options.DNSConfigurator,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("create wgengine: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user