wireguard.go 1.1 KB

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