local

package
v0.0.0-...-ee45651 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectProxyServerQUIC

func ConnectProxyServerQUIC(addr, target string) quic.Stream

func ConnectProxyServerQUICTest

func ConnectProxyServerQUICTest(addr string) error

func InitLimit

func InitLimit()

InitLimit IpLimit初始化

func IoCopy

func IoCopy(src io.ReadCloser, dst io.WriteCloser)

Types

type BaseLocalServer

type BaseLocalServer interface {
	Listen() error //a block function
	Stop() error
	Config(config *LocalServerConfig)
	Remote(remote remote.BaseRemote)
}

type HttpLocalServer

type HttpLocalServer struct {
	Conf *LocalServerConfig

	RetryCount int
	// contains filtered or unexported fields
}

func (*HttpLocalServer) Config

func (h *HttpLocalServer) Config(c *LocalServerConfig)

func (*HttpLocalServer) Listen

func (l *HttpLocalServer) Listen() error

Listen 启动监听

func (*HttpLocalServer) Remote

func (h *HttpLocalServer) Remote(r remote.BaseRemote)

func (*HttpLocalServer) SetLocalPort

func (l *HttpLocalServer) SetLocalPort(port int)

SetLocalPort 在服务器关闭的时候修改端口

func (*HttpLocalServer) Stop

func (l *HttpLocalServer) Stop() error

Stop 关闭服务器

type IpLimit

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

IpLimit 国内IP范围加载到程序中的结构

func (*IpLimit) Check

func (l *IpLimit) Check(domain string) bool

Check 使用二分查找算法检测IP是否在国内范围

type LocalServerConfig

type LocalServerConfig struct {
	Port          int
	Host          string
	Pac           bool //true:智能代理  , false: 全局代理
	OnListenError func(error)
}

func (*LocalServerConfig) ListenAddress

func (l *LocalServerConfig) ListenAddress() string

Jump to

Keyboard shortcuts

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