github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/transport/internet/security/security.go (about)

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