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
)

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"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*Account) Descriptor Uses

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

func (*Account) Equals Uses

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

func (*Account) GetSecret Uses

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

func (*Account) ProtoMessage Uses

func (*Account) ProtoMessage()

func (*Account) Reset Uses

func (m *Account) Reset()

func (*Account) String Uses

func (m *Account) String() string

func (*Account) XXX_DiscardUnknown Uses

func (m *Account) XXX_DiscardUnknown()

func (*Account) XXX_Marshal Uses

func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Account) XXX_Merge Uses

func (m *Account) XXX_Merge(src proto.Message)

func (*Account) XXX_Size Uses

func (m *Account) XXX_Size() int

func (*Account) XXX_Unmarshal Uses

func (m *Account) XXX_Unmarshal(b []byte) error

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 {
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*ClientConfig) Descriptor Uses

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

func (*ClientConfig) ProtoMessage Uses

func (*ClientConfig) ProtoMessage()

func (*ClientConfig) Reset Uses

func (m *ClientConfig) Reset()

func (*ClientConfig) String Uses

func (m *ClientConfig) String() string

func (*ClientConfig) XXX_DiscardUnknown Uses

func (m *ClientConfig) XXX_DiscardUnknown()

func (*ClientConfig) XXX_Marshal Uses

func (m *ClientConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClientConfig) XXX_Merge Uses

func (m *ClientConfig) XXX_Merge(src proto.Message)

func (*ClientConfig) XXX_Size Uses

func (m *ClientConfig) XXX_Size() int

func (*ClientConfig) XXX_Unmarshal Uses

func (m *ClientConfig) XXX_Unmarshal(b []byte) error

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"`
    XXX_NoUnkeyedLiteral struct{}         `json:"-"`
    XXX_unrecognized     []byte           `json:"-"`
    XXX_sizecache        int32            `json:"-"`
}

func (*ServerConfig) Descriptor Uses

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

func (*ServerConfig) GetUser Uses

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

func (*ServerConfig) ProtoMessage Uses

func (*ServerConfig) ProtoMessage()

func (*ServerConfig) Reset Uses

func (m *ServerConfig) Reset()

func (*ServerConfig) String Uses

func (m *ServerConfig) String() string

func (*ServerConfig) XXX_DiscardUnknown Uses

func (m *ServerConfig) XXX_DiscardUnknown()

func (*ServerConfig) XXX_Marshal Uses

func (m *ServerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServerConfig) XXX_Merge Uses

func (m *ServerConfig) XXX_Merge(src proto.Message)

func (*ServerConfig) XXX_Size Uses

func (m *ServerConfig) XXX_Size() int

func (*ServerConfig) XXX_Unmarshal Uses

func (m *ServerConfig) XXX_Unmarshal(b []byte) error

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 24 packages (graph) and is imported by 5 packages. Updated 2019-04-20. Refresh now. Tools for package owners.