tuic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package tuic
  2. import (
  3. C "github.com/metacubex/mihomo/constant"
  4. "github.com/metacubex/mihomo/transport/tuic/common"
  5. v4 "github.com/metacubex/mihomo/transport/tuic/v4"
  6. v5 "github.com/metacubex/mihomo/transport/tuic/v5"
  7. )
  8. type ClientOptionV4 = v4.ClientOption
  9. type ClientOptionV5 = v5.ClientOption
  10. type Client = common.Client
  11. func NewClientV4(clientOption *ClientOptionV4, udp bool, dialerRef C.Dialer) Client {
  12. return v4.NewClient(clientOption, udp, dialerRef)
  13. }
  14. func NewClientV5(clientOption *ClientOptionV5, udp bool, dialerRef C.Dialer) Client {
  15. return v5.NewClient(clientOption, udp, dialerRef)
  16. }
  17. type DialFunc = common.DialFunc
  18. var TooManyOpenStreams = common.TooManyOpenStreams
  19. const DefaultStreamReceiveWindow = common.DefaultStreamReceiveWindow
  20. const DefaultConnectionReceiveWindow = common.DefaultConnectionReceiveWindow
  21. var GenTKN = v4.GenTKN
  22. var PacketOverHeadV4 = v4.PacketOverHead
  23. var PacketOverHeadV5 = v5.PacketOverHead
  24. var MaxFragSizeV5 = v5.MaxFragSize
  25. type UdpRelayMode = common.UdpRelayMode
  26. const (
  27. QUIC = common.QUIC
  28. NATIVE = common.NATIVE
  29. )