reverse

package
v4.6.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Control_State_name = map[int32]string{
	0: "ACTIVE",
	1: "DRAIN",
}
View Source
var Control_State_value = map[string]int32{
	"ACTIVE": 0,
	"DRAIN":  1,
}

Functions

This section is empty.

Types

type Bridge

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

Bridge is a component in reverse proxy, that relays connections from Portal to local address.

func NewBridge

func NewBridge(config *BridgeConfig, dispatcher routing.Dispatcher) (*Bridge, error)

NewBridge creates a new Bridge instance.

func (*Bridge) Close

func (b *Bridge) Close() error

func (*Bridge) Start

func (b *Bridge) Start() error

type BridgeConfig

type BridgeConfig struct {
	Tag                  string   `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	Domain               string   `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BridgeConfig) Descriptor

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

func (*BridgeConfig) GetDomain

func (m *BridgeConfig) GetDomain() string

func (*BridgeConfig) GetTag

func (m *BridgeConfig) GetTag() string

func (*BridgeConfig) ProtoMessage

func (*BridgeConfig) ProtoMessage()

func (*BridgeConfig) Reset

func (m *BridgeConfig) Reset()

func (*BridgeConfig) String

func (m *BridgeConfig) String() string

func (*BridgeConfig) XXX_DiscardUnknown

func (m *BridgeConfig) XXX_DiscardUnknown()

func (*BridgeConfig) XXX_Marshal

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

func (*BridgeConfig) XXX_Merge

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

func (*BridgeConfig) XXX_Size

func (m *BridgeConfig) XXX_Size() int

func (*BridgeConfig) XXX_Unmarshal

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

type BridgeWorker

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

func NewBridgeWorker

func NewBridgeWorker(domain string, tag string, d routing.Dispatcher) (*BridgeWorker, error)

func (*BridgeWorker) Close

func (w *BridgeWorker) Close() error

func (*BridgeWorker) Connections

func (w *BridgeWorker) Connections() uint32

func (*BridgeWorker) Dispatch

func (w *BridgeWorker) Dispatch(ctx context.Context, dest net.Destination) (*transport.Link, error)

func (*BridgeWorker) IsActive

func (w *BridgeWorker) IsActive() bool

func (*BridgeWorker) Start

func (w *BridgeWorker) Start() error

func (*BridgeWorker) Type

func (w *BridgeWorker) Type() interface{}

type Config

type Config struct {
	BridgeConfig         []*BridgeConfig `protobuf:"bytes,1,rep,name=bridge_config,json=bridgeConfig,proto3" json:"bridge_config,omitempty"`
	PortalConfig         []*PortalConfig `protobuf:"bytes,2,rep,name=portal_config,json=portalConfig,proto3" json:"portal_config,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*Config) Descriptor

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

func (*Config) GetBridgeConfig

func (m *Config) GetBridgeConfig() []*BridgeConfig

func (*Config) GetPortalConfig

func (m *Config) GetPortalConfig() []*PortalConfig

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

func (*Config) XXX_DiscardUnknown

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal

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

func (*Config) XXX_Merge

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

func (*Config) XXX_Size

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal

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

type Control

type Control struct {
	State                Control_State `protobuf:"varint,1,opt,name=state,proto3,enum=v2ray.core.app.reverse.Control_State" json:"state,omitempty"`
	Random               []byte        `protobuf:"bytes,99,opt,name=random,proto3" json:"random,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*Control) Descriptor

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

func (*Control) FillInRandom

func (c *Control) FillInRandom()

func (*Control) GetRandom

func (m *Control) GetRandom() []byte

func (*Control) GetState

func (m *Control) GetState() Control_State

func (*Control) ProtoMessage

func (*Control) ProtoMessage()

func (*Control) Reset

func (m *Control) Reset()

func (*Control) String

func (m *Control) String() string

func (*Control) XXX_DiscardUnknown

func (m *Control) XXX_DiscardUnknown()

func (*Control) XXX_Marshal

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

func (*Control) XXX_Merge

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

func (*Control) XXX_Size

func (m *Control) XXX_Size() int

func (*Control) XXX_Unmarshal

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

type Control_State

type Control_State int32
const (
	Control_ACTIVE Control_State = 0
	Control_DRAIN  Control_State = 1
)

func (Control_State) EnumDescriptor

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

func (Control_State) String

func (x Control_State) String() string

type Outbound

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

func (*Outbound) Close

func (o *Outbound) Close() error

func (*Outbound) Dispatch

func (o *Outbound) Dispatch(ctx context.Context, link *transport.Link)

func (*Outbound) Start

func (o *Outbound) Start() error

func (*Outbound) Tag

func (o *Outbound) Tag() string

type Portal

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

func NewPortal

func NewPortal(config *PortalConfig, ohm outbound.Manager) (*Portal, error)

func (*Portal) Close

func (p *Portal) Close() error

func (*Portal) HandleConnection

func (p *Portal) HandleConnection(ctx context.Context, link *transport.Link) error

func (*Portal) Start

func (p *Portal) Start() error

type PortalConfig

type PortalConfig struct {
	Tag                  string   `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	Domain               string   `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PortalConfig) Descriptor

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

func (*PortalConfig) GetDomain

func (m *PortalConfig) GetDomain() string

func (*PortalConfig) GetTag

func (m *PortalConfig) GetTag() string

func (*PortalConfig) ProtoMessage

func (*PortalConfig) ProtoMessage()

func (*PortalConfig) Reset

func (m *PortalConfig) Reset()

func (*PortalConfig) String

func (m *PortalConfig) String() string

func (*PortalConfig) XXX_DiscardUnknown

func (m *PortalConfig) XXX_DiscardUnknown()

func (*PortalConfig) XXX_Marshal

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

func (*PortalConfig) XXX_Merge

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

func (*PortalConfig) XXX_Size

func (m *PortalConfig) XXX_Size() int

func (*PortalConfig) XXX_Unmarshal

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

type PortalWorker

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

func NewPortalWorker

func NewPortalWorker(client *mux.ClientWorker) (*PortalWorker, error)

func (*PortalWorker) Closed

func (w *PortalWorker) Closed() bool

func (*PortalWorker) IsFull

func (w *PortalWorker) IsFull() bool

type Reverse

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

func (*Reverse) Close

func (r *Reverse) Close() error

func (*Reverse) Init

func (r *Reverse) Init(config *Config, d routing.Dispatcher, ohm outbound.Manager) error

func (*Reverse) Start

func (r *Reverse) Start() error

func (*Reverse) Type

func (r *Reverse) Type() interface{}

type StaticMuxPicker

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

func NewStaticMuxPicker

func NewStaticMuxPicker() (*StaticMuxPicker, error)

func (*StaticMuxPicker) AddWorker

func (p *StaticMuxPicker) AddWorker(worker *PortalWorker)

func (*StaticMuxPicker) PickAvailable

func (p *StaticMuxPicker) PickAvailable() (*mux.ClientWorker, error)

Jump to

Keyboard shortcuts

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