Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoginDC ¶ added in v0.6.0
func LoginDC(sock io.ReadWriteCloser, protocol uint8) *rawStream
func ObfuscateDC ¶ added in v0.6.0
func ObfuscateDC(sock io.ReadWriteCloser, ctx *tgcrypt.DcCtx) *obfuscatedStream
Types ¶
type ClientHandler ¶ added in v0.7.1
type ClientHandler struct {
// contains filtered or unexported fields
}
func (*ClientHandler) HandleClient ¶ added in v0.7.1
func (o *ClientHandler) HandleClient() (err error)
type DCConnector ¶
type DCConnector interface { // Connect to the specified DC by it's number (may be negative) ConnectDC(dc int16) (c io.ReadWriteCloser, err error) // Connects to specific host (for fallback connections) ConnectHost(host string) (c net.Conn, err error) }
Connects client to the specified DC or fallback host
type DcDirectConnector ¶
type DcDirectConnector struct {
// contains filtered or unexported fields
}
Directly connects client
func NewDcDirectConnector ¶
func NewDcDirectConnector(allowIPv6 bool) *DcDirectConnector
creates a new DcDirectConnector
func (*DcDirectConnector) ConnectDC ¶
func (dcc *DcDirectConnector) ConnectDC(dc int16) (stream io.ReadWriteCloser, err error)
Connects client to the specified DC directly
func (*DcDirectConnector) ConnectHost ¶
func (dcc *DcDirectConnector) ConnectHost(host string) (net.Conn, error)
type DcSocksConnector ¶
type DcSocksConnector struct {
// contains filtered or unexported fields
}
Connects client over SOCKS5 proxy
func NewDcSocksConnector ¶
func NewDcSocksConnector(allowIPv6 bool, socks5 string, user, pass *string) *DcSocksConnector
Create a new DcSocksConnector
func (*DcSocksConnector) ConnectDC ¶
func (dsc *DcSocksConnector) ConnectDC(dc int16) (io.ReadWriteCloser, error)
connect to the specified DC over socks5
func (*DcSocksConnector) ConnectHost ¶
func (dsc *DcSocksConnector) ConnectHost(host string) (net.Conn, error)
type MiddleProxyManager ¶ added in v0.8.0
type MiddleProxyManager struct {
// contains filtered or unexported fields
}
func NewMiddleProxyManager ¶ added in v0.8.0
func NewMiddleProxyManager(cfg *config.Config) (*MiddleProxyManager, error)
func (*MiddleProxyManager) GetProxy ¶ added in v0.8.0
func (m *MiddleProxyManager) GetProxy(dc int16) (url4, url6 string, err error)
func (*MiddleProxyManager) GetSecret ¶ added in v0.8.0
func (m *MiddleProxyManager) GetSecret() []byte
get secret for middle proxies
type MiddleProxyStream ¶ added in v0.8.0
type MiddleProxyStream struct {
// contains filtered or unexported fields
}
func NewMiddleProxyStream ¶ added in v0.8.0
func NewMiddleProxyStream(mpStream dataStream, out, mp net.Conn, addTag []byte, protocolCli uint8) *MiddleProxyStream
func (*MiddleProxyStream) CloseStream ¶ added in v0.8.0
func (s *MiddleProxyStream) CloseStream() error
func (*MiddleProxyStream) Initiate ¶ added in v0.8.0
func (s *MiddleProxyStream) Initiate() (err error)
func (*MiddleProxyStream) ReadSrvMsg ¶ added in v0.8.0
func (m *MiddleProxyStream) ReadSrvMsg() (*message, error)
func (*MiddleProxyStream) WriteSrvMsg ¶ added in v0.8.0
func (m *MiddleProxyStream) WriteSrvMsg(msg *message) error
type MsgStreanCloser ¶ added in v0.8.0
type MsgStreanCloser interface {
CloseStream() error
}
Click to show internal directories.
Click to hide internal directories.