2022-08-16 23:37:51 +08:00
|
|
|
package option
|
|
|
|
|
2024-11-07 21:44:04 +08:00
|
|
|
import (
|
|
|
|
"net/netip"
|
|
|
|
|
|
|
|
"github.com/sagernet/sing/common/json/badoption"
|
|
|
|
)
|
2023-10-21 12:00:00 +08:00
|
|
|
|
2022-08-16 23:37:51 +08:00
|
|
|
type WireGuardOutboundOptions struct {
|
2022-09-03 12:55:10 +08:00
|
|
|
DialerOptions
|
2024-11-07 21:44:04 +08:00
|
|
|
SystemInterface bool `json:"system_interface,omitempty"`
|
|
|
|
GSO bool `json:"gso,omitempty"`
|
|
|
|
InterfaceName string `json:"interface_name,omitempty"`
|
|
|
|
LocalAddress badoption.Listable[netip.Prefix] `json:"local_address"`
|
|
|
|
PrivateKey string `json:"private_key"`
|
|
|
|
Peers []WireGuardPeer `json:"peers,omitempty"`
|
2023-03-31 12:31:26 +08:00
|
|
|
ServerOptions
|
|
|
|
PeerPublicKey string `json:"peer_public_key"`
|
|
|
|
PreSharedKey string `json:"pre_shared_key,omitempty"`
|
|
|
|
Reserved []uint8 `json:"reserved,omitempty"`
|
|
|
|
Workers int `json:"workers,omitempty"`
|
|
|
|
MTU uint32 `json:"mtu,omitempty"`
|
|
|
|
Network NetworkList `json:"network,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type WireGuardPeer struct {
|
|
|
|
ServerOptions
|
2024-11-07 21:44:04 +08:00
|
|
|
PublicKey string `json:"public_key,omitempty"`
|
|
|
|
PreSharedKey string `json:"pre_shared_key,omitempty"`
|
|
|
|
AllowedIPs badoption.Listable[string] `json:"allowed_ips,omitempty"`
|
|
|
|
Reserved []uint8 `json:"reserved,omitempty"`
|
2022-08-16 23:37:51 +08:00
|
|
|
}
|