wiretunnel

package module
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2025 License: MIT Imports: 17 Imported by: 0

README

Wiretunnel

Wiretunnel is a userspace WireGuard client that acts as a proxy server. It supports HTTP and SOCKS5 proxies with UDP associate.

Features

  • HTTP proxy

  • SOCKS5 proxy with UDP associate support

  • Choose between remote or local address resolution

Usage

./wiretunnel -cfg /path/to/wireguard/config
Flags
  • -cfg string: WireGuard configuration file path. $WG_CONFIG

  • -haddr string: HTTP server address, set '0' to disable, default ':8080'. $HTTP_ADDR

  • -huser string: HTTP proxy username. $HTTP_USER

  • -hpass string: HTTP proxy password. $HTTP_PASS

  • -saddr string: SOCKS5 server address, set '0' to disable, default ':1080'. $SOCKS5_ADDR

  • -suser string: SOCKS5 proxy username. $SOCKS5_USER

  • -spass string: SOCKS5 proxy password. $SOCKS5_PASS

  • -bl string: Bypass list of IPs separated by comma. $BYPASS_LIST

  • -ldns boolean: Resolve address locally. $LOCAL_DNS

  • -log boolean: Enable logging to stdout. $ENABLE_LOG

  • -v boolean: Print version and exit

Compile

go build ./cmd/wiretunnel

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDialer

func NewDialer(path string) (*wiredialer.WireDialer, error)

NewDialer returns a new wiredialer.WireDialer from a WireGuard configuration file.

func NewResolver added in v1.1.0

func NewResolver(d *wiredialer.WireDialer, localDNS bool) (*resolver, error)

NewResolver creates a new Resolver.

func ParseBypassList added in v1.2.2

func ParseBypassList(list string) []*net.IPNet

Types

type HTTPServer

type HTTPServer struct {
	Address  string
	Username string
	Password string

	Dialer     *wiredialer.WireDialer
	BypassList []*net.IPNet
	Resolver   Resolver
	// contains filtered or unexported fields
}

func (*HTTPServer) ListenAndServe

func (s *HTTPServer) ListenAndServe() error

ListenAndServe listens on the s.Address and serves HTTP requests.

func (*HTTPServer) ServeHTTP

func (s *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler interface.

type Resolver added in v1.1.0

type Resolver interface {
	LookupHost(ctx context.Context, host string) ([]string, error)
}

type SOCKS5Server

type SOCKS5Server struct {
	Address  string
	Username string
	Password string

	EnableLog bool

	Dialer     *wiredialer.WireDialer
	BypassList []*net.IPNet
	Resolver   Resolver
	// contains filtered or unexported fields
}

func (*SOCKS5Server) ListenAndServe

func (s *SOCKS5Server) ListenAndServe() error

ListenAndServe listens on the s.Address and serves SOCKS5 requests.

Directories

Path Synopsis
cmd
wiretunnel command

Jump to

Keyboard shortcuts

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