Documentation
¶
Index ¶
- Constants
- func HexSha224(password string) []byte
- func NewTrojanClient(ctx context.Context, url *url.URL) (proxy.Client, error)
- func NewTrojanServer(ctx context.Context, url *url.URL) (proxy.Server, error)
- func SHA224String(password string) string
- type Client
- type ClientConn
- type PacketConn
- type Server
- type ServerConn
- type User
- type UserManager
Constants ¶
View Source
const (
Name = "trojan"
)
Variables ¶
This section is empty.
Functions ¶
func NewTrojanClient ¶
func NewTrojanServer ¶
func SHA224String ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a vmess client
type ClientConn ¶
func (*ClientConn) Close ¶
func (c *ClientConn) Close() error
func (*ClientConn) Request ¶
func (c *ClientConn) Request() error
Request sends request to server. https://trojan-gfw.github.io/trojan/protocol
type PacketConn ¶
func (*PacketConn) GetTargetAddr ¶
func (pc *PacketConn) GetTargetAddr() *proxy.TargetAddr
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Handshake ¶
func (s *Server) Handshake(underlay net.Conn) (proxy.StreamConn, *proxy.TargetAddr, error)
type ServerConn ¶
ServerConn wrapper a net.Conn with trojan protocol
func (*ServerConn) Close ¶
func (c *ServerConn) Close() error
type UserManager ¶
type UserManager struct {
// contains filtered or unexported fields
}
Trojan user manager
func NewUserManager ¶
func NewUserManager(ctx context.Context, passwords ...string) *UserManager
Create Authenticator from user ids
func (*UserManager) DelUser ¶
func (m *UserManager) DelUser(hash string) error
func (*UserManager) ListUsers ¶
func (m *UserManager) ListUsers() []user.User
Click to show internal directories.
Click to hide internal directories.