github.com/sagernet/sing-box@v1.9.0-rc.20/option/wireguard.go (about)

     1  package option
     2  
     3  import "net/netip"
     4  
     5  type WireGuardOutboundOptions struct {
     6  	DialerOptions
     7  	SystemInterface bool                   `json:"system_interface,omitempty"`
     8  	GSO             bool                   `json:"gso,omitempty"`
     9  	InterfaceName   string                 `json:"interface_name,omitempty"`
    10  	LocalAddress    Listable[netip.Prefix] `json:"local_address"`
    11  	PrivateKey      string                 `json:"private_key"`
    12  	Peers           []WireGuardPeer        `json:"peers,omitempty"`
    13  	ServerOptions
    14  	PeerPublicKey string      `json:"peer_public_key"`
    15  	PreSharedKey  string      `json:"pre_shared_key,omitempty"`
    16  	Reserved      []uint8     `json:"reserved,omitempty"`
    17  	Workers       int         `json:"workers,omitempty"`
    18  	MTU           uint32      `json:"mtu,omitempty"`
    19  	Network       NetworkList `json:"network,omitempty"`
    20  }
    21  
    22  type WireGuardPeer struct {
    23  	ServerOptions
    24  	PublicKey    string           `json:"public_key,omitempty"`
    25  	PreSharedKey string           `json:"pre_shared_key,omitempty"`
    26  	AllowedIPs   Listable[string] `json:"allowed_ips,omitempty"`
    27  	Reserved     []uint8          `json:"reserved,omitempty"`
    28  }