wireguard.go 1.3 KB

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