msocks

package module
v0.0.0-...-a130017 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: AGPL-3.0 Imports: 37 Imported by: 0

README

https-socks

https-socks implements a simple socks-over-https proxy server.

Documentation

Index

Constants

View Source
const (
	TLSModeACME   = "acme"
	TLSModeStatic = "static"
)

TLS mode about how to configure the certificate source.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a SoH client with SOCKS4, SOCKS5 and HTTP proxy server.

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient is used to create SoH client.

func (*Client) Close

func (c *Client) Close() error

Close is used to close front server.

func (*Client) Login

func (c *Client) Login() error

Login is used to log in to server.

func (*Client) Logout

func (c *Client) Logout() error

Logout is used to log out to server.

func (*Client) Serve

func (c *Client) Serve() error

Serve is used to start front server.

type ClientConfig

type ClientConfig struct {
	Common struct {
		Password string `toml:"password"`
		LogPath  string `toml:"log_path"`
	} `toml:"common"`

	Client struct {
		Timeout  duration `toml:"timeout"`
		PreConns int      `toml:"pre_conns"`
	} `toml:"client"`

	Server struct {
		Network string `toml:"network"`
		Address string `toml:"address"`
		RootCA  string `toml:"root_ca"`
	} `toml:"server"`

	Front struct {
		Network  string `toml:"network"`
		Address  string `toml:"address"`
		Username string `toml:"username"`
		Password string `toml:"password"`
	} `toml:"front"`

	Tunnel struct {
		BufferSize  int `toml:"buffer_size"`
		JitterLevel int `toml:"jitter_level"`
	} `toml:"tunnel"`

	Android struct {
		DNSServer string `toml:"dns_server"`
	} `toml:"android"`

} // #nosec

ClientConfig contains configurations for proxy client.

type Server

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

Server is a SOCKS-over-HTTPS server.

func NewServer

func NewServer(ctx context.Context, config *ServerConfig) (*Server, error)

NewServer is used to create a SoH server.

func (*Server) Close

func (s *Server) Close() error

Close is used to close http server.

func (*Server) Serve

func (s *Server) Serve() error

Serve is used to start http server.

type ServerConfig

type ServerConfig struct {
	Common struct {
		PassHash string `toml:"pwd_hash"`
		LogPath  string `toml:"log_path"`
	} `toml:"common"`

	HTTP struct {
		Network  string   `toml:"network"`
		Address  string   `toml:"address"`
		Timeout  duration `toml:"timeout"`
		MaxConns int      `toml:"max_conns"`
	} `toml:"http"`

	TLS struct {
		Mode string `toml:"mode"`

		ACME struct {
			Domains []string `toml:"domains"`
		} `toml:"acme"`

		Static struct {
			Cert string `toml:"cert_path"`
			Key  string `toml:"key_path"`
		} `toml:"static"`
	} `toml:"tls"`

	Tunnel struct {
		MaxBufferSize int `toml:"max_buffer_size"`
	} `toml:"tunnel"`

	Web struct {
		Directory string `toml:"directory"`
	} `toml:"web"`
}

ServerConfig contains configurations for proxy server.

Directories

Path Synopsis
cmd
client command
server command

Jump to

Keyboard shortcuts

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