core: v2ray.com/core/proxy/mtproto Index | Files

package mtproto

import "v2ray.com/core/proxy/mtproto"

Index

Package Files

auth.go client.go config.go config.pb.go errors.generated.go mtproto.go server.go

Constants

const (
    HeaderSize = 64
)

Variables

var File_proxy_mtproto_config_proto protoreflect.FileDescriptor

func ContextWithSessionContext Uses

func ContextWithSessionContext(ctx context.Context, c SessionContext) context.Context

func Inverse Uses

func Inverse(b []byte) []byte

Inverse returns a new byte array. It is a sequence of bytes when the input is read from end to beginning.Inverse Visible for testing only.

type Account Uses

type Account struct {
    Secret []byte `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
    // contains filtered or unexported fields
}

func (*Account) Descriptor Uses

func (*Account) Descriptor() ([]byte, []int)

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) Equals Uses

func (a *Account) Equals(another protocol.Account) bool

func (*Account) GetSecret Uses

func (x *Account) GetSecret() []byte

func (*Account) ProtoMessage Uses

func (*Account) ProtoMessage()

func (*Account) ProtoReflect Uses

func (x *Account) ProtoReflect() protoreflect.Message

func (*Account) Reset Uses

func (x *Account) Reset()

func (*Account) String Uses

func (x *Account) String() string

type Authentication Uses

type Authentication struct {
    Header        [HeaderSize]byte
    DecodingKey   [32]byte
    EncodingKey   [32]byte
    DecodingNonce [16]byte
    EncodingNonce [16]byte
}

func NewAuthentication Uses

func NewAuthentication(sc SessionContext) *Authentication

func ReadAuthentication Uses

func ReadAuthentication(reader io.Reader) (*Authentication, error)

func (*Authentication) ApplySecret Uses

func (a *Authentication) ApplySecret(b []byte)

func (*Authentication) ConnectionType Uses

func (a *Authentication) ConnectionType() [4]byte

func (*Authentication) DataCenterID Uses

func (a *Authentication) DataCenterID() uint16

type Client Uses

type Client struct {
}

func NewClient Uses

func NewClient(ctx context.Context, config *ClientConfig) (*Client, error)

func (*Client) Process Uses

func (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error

type ClientConfig Uses

type ClientConfig struct {
    // contains filtered or unexported fields
}

func (*ClientConfig) Descriptor Uses

func (*ClientConfig) Descriptor() ([]byte, []int)

Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead.

func (*ClientConfig) ProtoMessage Uses

func (*ClientConfig) ProtoMessage()

func (*ClientConfig) ProtoReflect Uses

func (x *ClientConfig) ProtoReflect() protoreflect.Message

func (*ClientConfig) Reset Uses

func (x *ClientConfig) Reset()

func (*ClientConfig) String Uses

func (x *ClientConfig) String() string

type Server Uses

type Server struct {
    // contains filtered or unexported fields
}

func NewServer Uses

func NewServer(ctx context.Context, config *ServerConfig) (*Server, error)

func (*Server) Network Uses

func (s *Server) Network() []net.Network

func (*Server) Process Uses

func (s *Server) Process(ctx context.Context, network net.Network, conn internet.Connection, dispatcher routing.Dispatcher) error

type ServerConfig Uses

type ServerConfig struct {

    // User is a list of users that allowed to connect to this inbound.
    // Although this is a repeated field, only the first user is effective for
    // now.
    User []*protocol.User `protobuf:"bytes,1,rep,name=user,proto3" json:"user,omitempty"`
    // contains filtered or unexported fields
}

func (*ServerConfig) Descriptor Uses

func (*ServerConfig) Descriptor() ([]byte, []int)

Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead.

func (*ServerConfig) GetUser Uses

func (x *ServerConfig) GetUser() []*protocol.User

func (*ServerConfig) ProtoMessage Uses

func (*ServerConfig) ProtoMessage()

func (*ServerConfig) ProtoReflect Uses

func (x *ServerConfig) ProtoReflect() protoreflect.Message

func (*ServerConfig) Reset Uses

func (x *ServerConfig) Reset()

func (*ServerConfig) String Uses

func (x *ServerConfig) String() string

type SessionContext Uses

type SessionContext struct {
    ConnectionType [4]byte
    DataCenterID   uint16
}

func DefaultSessionContext Uses

func DefaultSessionContext() SessionContext

func SessionContextFromContext Uses

func SessionContextFromContext(ctx context.Context) SessionContext

Package mtproto imports 25 packages (graph) and is imported by 7 packages. Updated 2020-10-15. Refresh now. Tools for package owners.