Documentation
¶
Index ¶
- type CertificateFileConfig
- type Option
- func WhichAuthenticationHandler(handler authenticationHandler) Option
- func WhichErrorHandler(handler errorHandler) Option
- func WhichRequestHandler(handler requestHandler) Option
- func WithConfig(config *TrojanConfig) Option
- func WithConnectHandler(handler connectHandler) Option
- func WithDial(dial func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func WithLogger(l *logrus.Logger) Option
- type ReverseProxyConfig
- type Server
- type TLSConfig
- type TrojanConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateFileConfig ¶
type Option ¶
type Option func(s *Server)
func WhichAuthenticationHandler ¶
func WhichAuthenticationHandler(handler authenticationHandler) Option
func WhichErrorHandler ¶
func WhichErrorHandler(handler errorHandler) Option
func WhichRequestHandler ¶
func WhichRequestHandler(handler requestHandler) Option
func WithConfig ¶
func WithConfig(config *TrojanConfig) Option
func WithConnectHandler ¶
func WithConnectHandler(handler connectHandler) Option
func WithLogger ¶
type ReverseProxyConfig ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ListenAndServe ¶
type TLSConfig ¶
type TLSConfig struct {
MinVersion uint16 `json:"min_version"`
MaxVersion uint16 `json:"max_version"`
Certificate tls.Certificate
}
type TrojanConfig ¶
type TrojanConfig struct {
Password string `json:"password"`
TLSConfig *TLSConfig `json:"tls_config"`
ReverseProxyConfig *ReverseProxyConfig `json:"reverse_proxy"`
}
Click to show internal directories.
Click to hide internal directories.