blackhole

package
v2.21.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package blackhole is an outbound handler that blocks all connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Response *v2ray_core_common_serial.TypedMessage `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
}

func (*Config) Descriptor

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

func (*Config) GetInternalResponse

func (v *Config) GetInternalResponse() (ResponseConfig, error)

GetInternalResponse converts response settings from proto to internal data structure.

func (*Config) GetResponse

func (m *Config) GetResponse() *v2ray_core_common_serial.TypedMessage

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

type HTTPResponse

type HTTPResponse struct {
}

func (*HTTPResponse) Descriptor

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

func (*HTTPResponse) ProtoMessage

func (*HTTPResponse) ProtoMessage()

func (*HTTPResponse) Reset

func (m *HTTPResponse) Reset()

func (*HTTPResponse) String

func (m *HTTPResponse) String() string

func (*HTTPResponse) WriteTo

func (v *HTTPResponse) WriteTo(writer buf.Writer)

WriteTo implements ResponseConfig.WriteTo().

type Handler

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

Handler is an outbound connection that silently swallow the entire payload.

func New

func New(ctx context.Context, config *Config) (*Handler, error)

New creates a new blackhole handler.

func (*Handler) Process

func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error

Process implements OutboundHandler.Dispatch().

type NoneResponse

type NoneResponse struct {
}

func (*NoneResponse) Descriptor

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

func (*NoneResponse) ProtoMessage

func (*NoneResponse) ProtoMessage()

func (*NoneResponse) Reset

func (m *NoneResponse) Reset()

func (*NoneResponse) String

func (m *NoneResponse) String() string

func (*NoneResponse) WriteTo

func (v *NoneResponse) WriteTo(buf.Writer)

WriteTo implements ResponseConfig.WriteTo().

type ResponseConfig

type ResponseConfig interface {
	// WriteTo writes predefined response to the give buffer.
	WriteTo(buf.Writer)
}

ResponseConfig is the configuration for blackhole responses.

Jump to

Keyboard shortcuts

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