feature/ace: make ACE modular
Updates #12614 Change-Id: Iaee75d8831c4ba5c9705d7877bb78044424c6da1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
141eb64d3f
commit
223ced84b5
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
// Package ace registers support for Alternate Connectivity Endpoints (ACE).
|
||||
package ace
|
||||
|
||||
import (
|
||||
"net/netip"
|
||||
|
||||
"tailscale.com/control/controlhttp"
|
||||
"tailscale.com/net/ace"
|
||||
"tailscale.com/net/netx"
|
||||
)
|
||||
|
||||
func init() {
|
||||
controlhttp.HookMakeACEDialer.Set(mkDialer)
|
||||
}
|
||||
|
||||
func mkDialer(dialer netx.DialFunc, aceHost string, optIP netip.Addr) netx.DialFunc {
|
||||
return (&ace.Dialer{
|
||||
ACEHost: aceHost,
|
||||
ACEHostIP: optIP, // may be zero
|
||||
NetDialer: dialer,
|
||||
}).Dial
|
||||
}
|
||||
Reference in New Issue
Block a user