extend

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpsProxyEstablished = "HTTP/1.1 200 Connection Established\r\n\r\n"
)

Variables

View Source
var (
	Users       = make(map[string]string)
	DnsResolver = getEnvOr("FCK_DNS_RESOLVER", "")

	UserName      = getEnvOr("FCK_USER_NAME", "USER_NAME")
	Password      = getEnvOr("FCK_PASSWORD", "PASSWORD")
	Salt          = getEnvOr("FCK_SALT", "SALT")
	RemoteHost    = getEnvOr("FCK_REMOTE_HOST", "127.0.0.1")
	RemotePort    = getEnvOr("FCK_REMOTE_PORT", "443")
	HttpDomain    = getEnvOr("FCK_REMOTE_DOMAIN", "test.com")
	HttpPath      = getEnvOr("FCK_REMOTE_HTTP_PATH", "/yyuiopk")
	HttpUserAgent = getEnvOr("FCK_REMOTE_HTTP_UA", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0")
	RemoteSSL     = getEnvOr("FCK_REMOTE_HTTPS", "true") != "false"
	AllowInsecure = getEnvOr("FCK_REMOTE_HTTPS_TRUST_ALL", "false") == "false"
)

Functions

func DialTCPContext

func DialTCPContext(ctx context.Context, address string) (net.Conn, error)

func DialTLSContext

func DialTLSContext(ctx context.Context, network, addr string, cfg *tls.Config) (net.Conn, error)

func GetAuthorizedConn

func GetAuthorizedConn(ctx context.Context, host string, port string) (*net.Conn, error)

和Remote服务器建立连接,并进行鉴权处理

func HandleConnect

func HandleConnect(w http.ResponseWriter, r *http.Request)

Handler for basic http

func HandleConnectH2

func HandleConnectH2(w http.ResponseWriter, r *http.Request)

Handler for basic http

func HandleError

func HandleError()

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler for basic http

func HandlerH2

func HandlerH2(w http.ResponseWriter, r *http.Request)

Handler for basic http

func HandlerH3

func HandlerH3(w http.ResponseWriter, r *http.Request)

Handler for basic http

func HandlerRealWs

func HandlerRealWs(w http.ResponseWriter, r *http.Request)

Handler for basic http

func Pip

func Pip(from io.ReadCloser, to io.WriteCloser)

func RandKey

func RandKey() string

Types

type IdConnMap

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

func NewIdConnMap

func NewIdConnMap() *IdConnMap

func (*IdConnMap) Delete

func (m *IdConnMap) Delete(id string)

func (*IdConnMap) Get

func (m *IdConnMap) Get(id string) (net.Conn, bool)

func (*IdConnMap) Set

func (m *IdConnMap) Set(id string, conn net.Conn)

type Mux

type Mux struct {
	ServeMux                 *http.ServeMux
	ConnectMethodHandlerFunc *http.HandlerFunc
}

func NewMux

func NewMux(ConnectMethodHandlerFunc *http.HandlerFunc, ServeMux *http.ServeMux) *Mux

func (*Mux) Handle

func (mux *Mux) Handle(pattern string, handler http.Handler)

func (*Mux) HandleFunc

func (mux *Mux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

func (*Mux) ServeHTTP

func (mux *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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