internet

package
v2.2.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package internet is a generated protocol buffer package.

It is generated from these files:

v2ray.com/core/transport/internet/authenticator.proto
v2ray.com/core/transport/internet/config.proto

It has these top-level messages:

AuthenticatorConfig
SecuritySettings
NetworkSettings
StreamConfig

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnconfiguredNetwork = errors.New("Network config creator not set.")
)
View Source
var (
	ErrUnsupportedStreamType = errors.New("Unsupported stream type.")
)
View Source
var SecurityType_name = map[int32]string{
	0: "None",
	1: "TLS",
}
View Source
var SecurityType_value = map[string]int32{
	"None": 0,
	"TLS":  1,
}

Functions

func ApplyGlobalNetworkSettings

func ApplyGlobalNetworkSettings(settings []*NetworkSettings) error

func CreateNetworkConfig

func CreateNetworkConfig(network v2net.Network) (proto.Message, error)

func CreateSecurityConfig

func CreateSecurityConfig(securityType SecurityType) (proto.Message, error)

func DialToDest

func DialToDest(src v2net.Address, dest v2net.Destination) (net.Conn, error)

func RegisterAuthenticator added in v1.23.1

func RegisterAuthenticator(name string, factory AuthenticatorFactory) error

func RegisterAuthenticatorConfig

func RegisterAuthenticatorConfig(name string, configCreator loader.ConfigCreator) error

func RegisterNetworkConfigCreator

func RegisterNetworkConfigCreator(network v2net.Network, creator NetworkConfigCreator) error

func RegisterSecurityConfigCreator

func RegisterSecurityConfigCreator(securityType SecurityType, creator NetworkConfigCreator) error

func SubstituteDialer added in v1.21.2

func SubstituteDialer(dialer SystemDialerAdapter) error

SubstituteDialer replaces the current system dialer with a given one. Caller must ensure there is no race condition. @Deprecated: Use UseAlternativeSimpleSystemDialer.

func UseAlternativeSystemDialer added in v1.21.2

func UseAlternativeSystemDialer(dialer SystemDialer)

UseAlternativeSystemDialer replaces the current system dialer with a given one. Caller must ensure there is no race condition.

Types

type Authenticator added in v1.23.1

type Authenticator interface {
	Seal(*alloc.Buffer)
	Open(*alloc.Buffer) bool
	Overhead() int
}

func CreateAuthenticator added in v1.23.1

func CreateAuthenticator(name string, config interface{}) (Authenticator, error)

func NewAuthenticatorChain added in v1.23.1

func NewAuthenticatorChain(auths ...Authenticator) Authenticator

type AuthenticatorChain added in v1.23.1

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

func (*AuthenticatorChain) Open added in v1.23.1

func (this *AuthenticatorChain) Open(payload *alloc.Buffer) bool

func (*AuthenticatorChain) Overhead added in v1.23.1

func (this *AuthenticatorChain) Overhead() int

func (*AuthenticatorChain) Seal added in v1.23.1

func (this *AuthenticatorChain) Seal(payload *alloc.Buffer)

type AuthenticatorConfig added in v1.23.1

type AuthenticatorConfig struct {
	Name     string               `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Settings *google_protobuf.Any `protobuf:"bytes,2,opt,name=settings" json:"settings,omitempty"`
}

func NewAuthenticatorConfig

func NewAuthenticatorConfig(name string, config interface{}) (*AuthenticatorConfig, error)

func (*AuthenticatorConfig) CreateAuthenticator

func (this *AuthenticatorConfig) CreateAuthenticator() (Authenticator, error)

func (*AuthenticatorConfig) Descriptor

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

func (*AuthenticatorConfig) GetInternalConfig

func (this *AuthenticatorConfig) GetInternalConfig() (interface{}, error)

func (*AuthenticatorConfig) GetSettings

func (m *AuthenticatorConfig) GetSettings() *google_protobuf.Any

func (*AuthenticatorConfig) ProtoMessage

func (*AuthenticatorConfig) ProtoMessage()

func (*AuthenticatorConfig) Reset

func (m *AuthenticatorConfig) Reset()

func (*AuthenticatorConfig) String

func (m *AuthenticatorConfig) String() string

type AuthenticatorFactory added in v1.23.1

type AuthenticatorFactory interface {
	Create(interface{}) Authenticator
}

type Connection

type Connection interface {
	net.Conn
	Reusable
}

func Dial

func Dial(src v2net.Address, dest v2net.Destination, settings *StreamConfig) (Connection, error)

type ConnectionHandler

type ConnectionHandler func(Connection)

type DefaultSystemDialer added in v1.21.2

type DefaultSystemDialer struct {
}

func (*DefaultSystemDialer) Dial added in v1.21.2

func (this *DefaultSystemDialer) Dial(src v2net.Address, dest v2net.Destination) (net.Conn, error)

type Dialer

type Dialer func(src v2net.Address, dest v2net.Destination, options DialerOptions) (Connection, error)
var (
	TCPDialer    Dialer
	KCPDialer    Dialer
	RawTCPDialer Dialer
	UDPDialer    Dialer
	WSDialer     Dialer
)

type DialerOptions

type DialerOptions struct {
	Stream *StreamConfig
}

type ListenFunc

type ListenFunc func(address v2net.Address, port v2net.Port, options ListenOptions) (Listener, error)
var (
	ErrClosedConnection = errors.New("Connection already closed.")

	KCPListenFunc    ListenFunc
	TCPListenFunc    ListenFunc
	RawTCPListenFunc ListenFunc
	WSListenFunc     ListenFunc
)

type ListenOptions

type ListenOptions struct {
	Stream *StreamConfig
}

type Listener

type Listener interface {
	Accept() (Connection, error)
	Close() error
	Addr() net.Addr
}

type NetworkConfigCreator

type NetworkConfigCreator func() proto.Message

type NetworkSettings

type NetworkSettings struct {
	Network  v2ray_core_common_net.Network `protobuf:"varint,1,opt,name=network,enum=v2ray.core.common.net.Network" json:"network,omitempty"`
	Settings *google_protobuf.Any          `protobuf:"bytes,2,opt,name=settings" json:"settings,omitempty"`
}

func (*NetworkSettings) Descriptor

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

func (*NetworkSettings) GetSettings

func (m *NetworkSettings) GetSettings() *google_protobuf.Any

func (*NetworkSettings) GetTypedSettings

func (this *NetworkSettings) GetTypedSettings() (interface{}, error)

func (*NetworkSettings) ProtoMessage

func (*NetworkSettings) ProtoMessage()

func (*NetworkSettings) Reset

func (m *NetworkSettings) Reset()

func (*NetworkSettings) String

func (m *NetworkSettings) String() string

type Reusable

type Reusable interface {
	Reusable() bool
	SetReusable(reuse bool)
}

type SecuritySettings

type SecuritySettings struct {
	Type     SecurityType         `protobuf:"varint,1,opt,name=type,enum=v2ray.core.transport.internet.SecurityType" json:"type,omitempty"`
	Settings *google_protobuf.Any `protobuf:"bytes,2,opt,name=settings" json:"settings,omitempty"`
}

func (*SecuritySettings) Descriptor

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

func (*SecuritySettings) GetSettings

func (m *SecuritySettings) GetSettings() *google_protobuf.Any

func (*SecuritySettings) GetTypeSettings

func (this *SecuritySettings) GetTypeSettings() (interface{}, error)

func (*SecuritySettings) ProtoMessage

func (*SecuritySettings) ProtoMessage()

func (*SecuritySettings) Reset

func (m *SecuritySettings) Reset()

func (*SecuritySettings) String

func (m *SecuritySettings) String() string

type SecurityType

type SecurityType int32
const (
	SecurityType_None SecurityType = 0
	SecurityType_TLS  SecurityType = 1
)

func (SecurityType) EnumDescriptor

func (SecurityType) EnumDescriptor() ([]byte, []int)

func (SecurityType) String

func (x SecurityType) String() string

type SimpleSystemDialer added in v1.21.2

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

func (*SimpleSystemDialer) Dial added in v1.21.2

func (this *SimpleSystemDialer) Dial(src v2net.Address, dest v2net.Destination) (net.Conn, error)

type StreamConfig

type StreamConfig struct {
	Network          v2ray_core_common_net.Network `protobuf:"varint,1,opt,name=network,enum=v2ray.core.common.net.Network" json:"network,omitempty"`
	NetworkSettings  []*NetworkSettings            `protobuf:"bytes,2,rep,name=network_settings,json=networkSettings" json:"network_settings,omitempty"`
	SecurityType     SecurityType                  `` /* 139-byte string literal not displayed */
	SecuritySettings []*SecuritySettings           `protobuf:"bytes,4,rep,name=security_settings,json=securitySettings" json:"security_settings,omitempty"`
}

func (*StreamConfig) Descriptor

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

func (*StreamConfig) GetEffectiveNetworkSettings

func (this *StreamConfig) GetEffectiveNetworkSettings() (interface{}, error)

func (*StreamConfig) GetEffectiveSecuritySettings

func (this *StreamConfig) GetEffectiveSecuritySettings() (interface{}, error)

func (*StreamConfig) GetNetworkSettings

func (m *StreamConfig) GetNetworkSettings() []*NetworkSettings

func (*StreamConfig) GetSecuritySettings

func (m *StreamConfig) GetSecuritySettings() []*SecuritySettings

func (*StreamConfig) ProtoMessage

func (*StreamConfig) ProtoMessage()

func (*StreamConfig) Reset

func (m *StreamConfig) Reset()

func (*StreamConfig) String

func (m *StreamConfig) String() string

type SysFd added in v1.18.1

type SysFd interface {
	SysFd() (int, error)
}

type SystemDialer added in v1.21.2

type SystemDialer interface {
	Dial(source v2net.Address, destination v2net.Destination) (net.Conn, error)
}

func WithAdapter added in v1.21.2

func WithAdapter(dialer SystemDialerAdapter) SystemDialer

type SystemDialerAdapter added in v1.21.2

type SystemDialerAdapter interface {
	Dial(network string, address string) (net.Conn, error)
}

type TCPHub

type TCPHub struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func ListenTCP

func ListenTCP(address v2net.Address, port v2net.Port, callback ConnectionHandler, settings *StreamConfig) (*TCPHub, error)

func (*TCPHub) Close

func (this *TCPHub) Close()

Directories

Path Synopsis
authenticators
noop
Package noop is a generated protocol buffer package.
Package noop is a generated protocol buffer package.
srtp
Package srtp is a generated protocol buffer package.
Package srtp is a generated protocol buffer package.
utp
Package utp is a generated protocol buffer package.
Package utp is a generated protocol buffer package.
Package kcp is a generated protocol buffer package.
Package kcp is a generated protocol buffer package.
Package tcp is a generated protocol buffer package.
Package tcp is a generated protocol buffer package.
Package tls is a generated protocol buffer package.
Package tls is a generated protocol buffer package.
Package ws is a generated protocol buffer package.
Package ws is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL