security.go 524 B

123456789101112131415161718192021222324252627282930313233
  1. package security
  2. //go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
  3. import (
  4. "github.com/v2fly/v2ray-core/v5/common/net"
  5. )
  6. type Engine interface {
  7. Client(conn net.Conn, opts ...Option) (Conn, error)
  8. }
  9. type Conn interface {
  10. net.Conn
  11. }
  12. type Option interface {
  13. isSecurityOption()
  14. }
  15. type OptionWithALPN struct {
  16. ALPNs []string
  17. }
  18. func (a OptionWithALPN) isSecurityOption() {
  19. }
  20. type OptionWithDestination struct {
  21. Dest net.Destination
  22. }
  23. func (a OptionWithDestination) isSecurityOption() {
  24. }