You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
551 B
25 lines
551 B
// Copyright (c) Tailscale Inc & contributors
|
|
// 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
|
|
}
|
|
|