libinject

package module
v0.0.0-...-1199d5d Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: GPL-3.0 Imports: 12 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Loop          = true
	DefaultConfig = &Config{
		Enable: true,
		Type:   0,
		Port:   "2024",
		Rules: map[string][]string{
			"*:*": []string{
				"*",
			},
		},
		Payload:              "[raw][crlf]Host: t.co[crlf]Host: [crlf][crlf]",
		ServerNameIndication: "",
		MeekType:             0,
		Timeout:              5,
		ShowLog:              false,
	}
)

Functions

This section is empty.

Types

type ClientRequest

type ClientRequest map[string]string

type Config

type Config struct {
	Enable               bool
	Type                 int
	Port                 string
	Rules                map[string][]string
	Payload              string
	ServerNameIndication string
	MeekType             int
	Timeout              int
	ShowLog              bool
}

type Inject

type Inject struct {
	Redsocks *libredsocks.Redsocks
	Config   *Config
}

func (*Inject) DecodePayload

func (i *Inject) DecodePayload(request ClientRequest, payload string) string

func (*Inject) ExtractClientRequest

func (i *Inject) ExtractClientRequest(c net.Conn) (map[string]string, error)

func (*Inject) Forward

func (i *Inject) Forward(c net.Conn)

func (*Inject) GetProxy

func (i *Inject) GetProxy(request map[string]string) (string, int, error)

func (*Inject) GetProxyFromRule

func (i *Inject) GetProxyFromRule(w string) []string

func (*Inject) Handle

func (i *Inject) Handle(w io.Writer, r io.Reader, done chan bool)

func (*Inject) Handler

func (i *Inject) Handler(c net.Conn, s net.Conn)

func (*Inject) NewConnection

func (i *Inject) NewConnection(proxyHost string, proxyPort int, request map[string]string) (net.Conn, error)

func (*Inject) ReadResponse

func (i *Inject) ReadResponse(r net.Conn) string

func (*Inject) Start

func (i *Inject) Start()

func (*Inject) TunnelType0

func (i *Inject) TunnelType0(c net.Conn, request ClientRequest)

func (*Inject) TunnelType1

func (i *Inject) TunnelType1(c net.Conn, request ClientRequest)

func (*Inject) TunnelType2

func (i *Inject) TunnelType2(c net.Conn, request ClientRequest)

Jump to

Keyboard shortcuts

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