hysteria.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package option
  2. import (
  3. "github.com/sagernet/sing/common/byteformats"
  4. "github.com/sagernet/sing/common/json/badoption"
  5. )
  6. type HysteriaInboundOptions struct {
  7. ListenOptions
  8. Up *byteformats.NetworkBytesCompat `json:"up,omitempty"`
  9. UpMbps int `json:"up_mbps,omitempty"`
  10. Down *byteformats.NetworkBytesCompat `json:"down,omitempty"`
  11. DownMbps int `json:"down_mbps,omitempty"`
  12. Obfs string `json:"obfs,omitempty"`
  13. Users []HysteriaUser `json:"users,omitempty"`
  14. ReceiveWindowConn uint64 `json:"recv_window_conn,omitempty"`
  15. ReceiveWindowClient uint64 `json:"recv_window_client,omitempty"`
  16. MaxConnClient int `json:"max_conn_client,omitempty"`
  17. DisableMTUDiscovery bool `json:"disable_mtu_discovery,omitempty"`
  18. InboundTLSOptionsContainer
  19. }
  20. type HysteriaUser struct {
  21. Name string `json:"name,omitempty"`
  22. Auth []byte `json:"auth,omitempty"`
  23. AuthString string `json:"auth_str,omitempty"`
  24. }
  25. type HysteriaOutboundOptions struct {
  26. DialerOptions
  27. ServerOptions
  28. ServerPorts badoption.Listable[string] `json:"server_ports,omitempty"`
  29. HopInterval badoption.Duration `json:"hop_interval,omitempty"`
  30. Up *byteformats.NetworkBytesCompat `json:"up,omitempty"`
  31. UpMbps int `json:"up_mbps,omitempty"`
  32. Down *byteformats.NetworkBytesCompat `json:"down,omitempty"`
  33. DownMbps int `json:"down_mbps,omitempty"`
  34. Obfs string `json:"obfs,omitempty"`
  35. Auth []byte `json:"auth,omitempty"`
  36. AuthString string `json:"auth_str,omitempty"`
  37. ReceiveWindowConn uint64 `json:"recv_window_conn,omitempty"`
  38. ReceiveWindow uint64 `json:"recv_window,omitempty"`
  39. DisableMTUDiscovery bool `json:"disable_mtu_discovery,omitempty"`
  40. Network NetworkList `json:"network,omitempty"`
  41. OutboundTLSOptionsContainer
  42. }