windproxy

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 28 Imported by: 0

README ΒΆ

windproxy πŸƒπŸ’»

This project has been created as a fork of Snawoot/windscribe-proxy. The main goal is to add features to randomize the proxy location and allow to rotate the IP without restarting the server. The code might also be refactored to adapt it to my coding style.

Standalone Windscribe proxy client.

Just run it and it'll start a plain HTTP proxy server forwarding traffic through Windscribe proxies of your choice. By default the application listens on 127.0.0.1:28080.

πŸš€ Features

  • Cross-platform (Windows/Mac OS/Linux/Android (via shell)/*BSD)
  • Uses TLS for secure communication with upstream proxies
  • Zero configuration
  • Simple and straightforward
  • Rotates IP address without restarting the server
  • Use a random location for the proxy

πŸ“¦ Installation

You can use the Golang binary to install windproxy:

go install github.com/igolaizola/windproxy/cmd/windproxy@latest

Or you can download the binary from the releases.

πŸ•ΉοΈ Usage

List available locations:

windproxy list-locations

Run proxy via location of your choice:

windproxy run --location Germany/Frankfurt

Also it is possible to export proxy addresses and credentials:

windproxy list-proxies

Refresh the server IP address without restarting the server. Launch a GET /windproxy-refresh request to the proxy server:

curl -X GET http://host:port/windproxy-refresh

πŸ› οΈ Parameters

Here is the fixed table with consistent formatting and corrected spacing:

Argument Type Description
2fa String 2FA code for login
auth-secret String client auth secret (default 952b4412f002315aa50751032fcaab03)
bind-address String HTTP proxy listen address (default 127.0.0.1:28080)
cafile String use custom CA certificate bundle file
fake-sni String fake SNI to use to contact windscribe servers (default "com")
force-cold-init bool force cold init
location String desired proxy location. Default: best location
random bool use random location
password String password for login
proxy String sets base proxy to use for all dial-outs. Format: <http|https|socks5|socks5h>://[login:password@]host[:port]. Examples: http://user:password@192.168.1.1:3128, socks5://10.0.0.1:1080
resolver String use DNS/DoH/DoT/DoQ resolver for all dial-outs. See https://github.com/ameshkov/dnslookup/ for upstream DNS URL format. Examples: https://1.1.1.1/dns-query, quic://dns.adguard.com
state-file String file name used to persist Windscribe API client state. Default: wndstate.json
timeout Duration timeout for network operations. Default: 10s
username String username for login
verbosity Number logging verbosity (10 - debug, 20 - info, 30 - warning, 40 - error, 50 - critical). Default: 20
refresh-path String path to trigger the endpoint refresh. Default: /windproxy-refresh

πŸ“š Resources

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

View Source
const (
	CRITICAL = 50
	ERROR    = 40
	WARNING  = 30
	INFO     = 20
	DEBUG    = 10
	NOTSET   = 0
)
View Source
const (
	DOT                  = 0x2e
	DNS_CACHE_SIZE_LIMIT = 1024
)
View Source
const (
	PROXY_CONNECT_METHOD       = "CONNECT"
	PROXY_HOST_HEADER          = "Host"
	PROXY_AUTHORIZATION_HEADER = "Proxy-Authorization"
)
View Source
const (
	COPY_BUF            = 128 * 1024
	WALLCLOCK_PRECISION = 1 * time.Second
)
View Source
const (
	DEFAULT_CLIENT_AUTH_SECRET        = "952b4412f002315aa50751032fcaab03"
	ASSUMED_PROXY_PORT         uint16 = 443
)
View Source
const BAD_REQ_MSG = "Bad Request\n"
View Source
const MAX_LOG_QLEN = 128
View Source
const QUEUE_SHUTDOWN_TIMEOUT = 500 * time.Millisecond

Variables ΒΆ

This section is empty.

Functions ΒΆ

func AfterWallClock ΒΆ

func AfterWallClock(d time.Duration) <-chan time.Time

func ListLocations ΒΆ

func ListLocations(ctx context.Context, cfg *Config) error

func ListProxies ΒΆ

func ListProxies(ctx context.Context, cfg *Config) error

func Run ΒΆ

func Run(ctx context.Context, cfg *Config) error

Types ΒΆ

type AuthProvider ΒΆ

type AuthProvider func() string

type CondLogger ΒΆ

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

func NewCondLogger ΒΆ

func NewCondLogger(logger *log.Logger, verbosity int) *CondLogger

func (*CondLogger) Critical ΒΆ

func (cl *CondLogger) Critical(s string, v ...interface{}) error

func (*CondLogger) Debug ΒΆ

func (cl *CondLogger) Debug(s string, v ...interface{}) error

func (*CondLogger) Error ΒΆ

func (cl *CondLogger) Error(s string, v ...interface{}) error

func (*CondLogger) Info ΒΆ

func (cl *CondLogger) Info(s string, v ...interface{}) error

func (*CondLogger) Log ΒΆ

func (cl *CondLogger) Log(verb int, format string, v ...interface{}) error

func (*CondLogger) Warning ΒΆ

func (cl *CondLogger) Warning(s string, v ...interface{}) error

type Config ΒΆ

type Config struct {
	Location         string
	Random           bool
	BindAddress      string
	Verbosity        int
	Timeout          time.Duration
	Proxy            string
	Resolver         string
	CAFile           string
	ClientAuthSecret string
	StateFile        string
	Username         string
	Password         string
	Tfacode          string
	FakeSNI          string
	ForceColdInit    bool
	RefreshPath      string
}

type ContextDialer ΒΆ

type ContextDialer interface {
	Dialer
	DialContext(ctx context.Context, network, address string) (net.Conn, error)
}

type Dialer ΒΆ

type Dialer interface {
	Dial(network, address string) (net.Conn, error)
}

type FakeSNIDialer ΒΆ

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

func NewFakeSNIDialer ΒΆ

func NewFakeSNIDialer(caPool *x509.CertPool, sni string, nextDialer ContextDialer) *FakeSNIDialer

func (*FakeSNIDialer) DialTLSContext ΒΆ

func (d *FakeSNIDialer) DialTLSContext(ctx context.Context, network, addr string) (net.Conn, error)

type LogWriter ΒΆ

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

func NewLogWriter ΒΆ

func NewLogWriter(writer io.Writer) *LogWriter

func (*LogWriter) Close ΒΆ

func (lw *LogWriter) Close()

func (*LogWriter) Write ΒΆ

func (lw *LogWriter) Write(p []byte) (int, error)

type ProxyDialer ΒΆ

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

func NewProxyDialer ΒΆ

func NewProxyDialer(getAddress func() (address, tlsServerName string), sni string, auth AuthProvider, caPool *x509.CertPool, nextDialer ContextDialer) *ProxyDialer

func ProxyDialerFromURL ΒΆ

func ProxyDialerFromURL(u *url.URL, next ContextDialer) (*ProxyDialer, error)

func (*ProxyDialer) Dial ΒΆ

func (d *ProxyDialer) Dial(network, address string) (net.Conn, error)

func (*ProxyDialer) DialContext ΒΆ

func (d *ProxyDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

type ProxyHandler ΒΆ

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

func NewProxyHandler ΒΆ

func NewProxyHandler(dialer ContextDialer, logger *CondLogger, refreshC chan<- struct{}, refreshPath string) *ProxyHandler

func (*ProxyHandler) HandleRequest ΒΆ

func (s *ProxyHandler) HandleRequest(wr http.ResponseWriter, req *http.Request)

func (*ProxyHandler) HandleTunnel ΒΆ

func (s *ProxyHandler) HandleTunnel(wr http.ResponseWriter, req *http.Request)

func (*ProxyHandler) ServeHTTP ΒΆ

func (s *ProxyHandler) ServeHTTP(wr http.ResponseWriter, req *http.Request)

type Resolver ΒΆ

type Resolver struct {
}

type ResolvingDialer ΒΆ

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

func NewResolvingDialer ΒΆ

func NewResolvingDialer(resolverAddress string, timeout time.Duration, next ContextDialer, logger *CondLogger) (*ResolvingDialer, error)

func (*ResolvingDialer) Dial ΒΆ

func (d *ResolvingDialer) Dial(network, address string) (net.Conn, error)

func (*ResolvingDialer) DialContext ΒΆ

func (d *ResolvingDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

Directories ΒΆ

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

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