gsocks5

command module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 16 Imported by: 0

README

GSocks5

Go Version License

It's a simple socks5 server based on go-socks5 with authentication and custom dns resolving.

It also uses github.com/serjs/socks5-server ideas.

Parameters:

Usage of ./gsocks5:
  -auth value
        authentication file
  -connections value
        number of concurrent connections in range [1, 10000] (default 100)
  -debug
        debug mode
  -dns string
        custom DNS server
  -dt duration
        dns connection timeout (default 5s)
  -host string
        server host
  -port value
        TCP port number to listen on in range [1, 65535] (default 1080)
  -t duration
        connection timeout (default 3m0s)
  -version
        show version

For custom DNS server you can use:

DockerHub image z0rr0/gsocks5.

Build

Local build:

# static binary
make build

# docker image
make docker

Run

Local:

# without host parameter it listens on all interfaces
./gsocks5 -host 127.0.0.1 -port 1080

Docker:

# run container with custom parameters
# -dns can be omitted, then it uses default host DSN resolver
#
# for example there is a file "data/users.txt" with users passwords
# > cat data/users.txt
# user1 password1
# user2 password2

docker run -d \
  --name gsocks5 \
  -u $UID:$UID \
  --log-opt max-size=10m \
  --memory 64m \
  -p 1181:1080 \
  -v $PWD/data:/data/auth:ro \
  --restart always \
  z0rr0/gsocks5:latest -auth /data/auth/users.txt -dns 8.8.8.8

Check

curl --socks5 <IP>:<PORT> <TARGET_URL>

Where

  • <IP> is your server IP (localhost if you run server locally).
  • <PORT> is your server port (1080 by default).
  • <TARGET_URL> is URL you want to check, for example https://fwtf.xyz/short

With authentication:

curl --socks5 <IP>:<PORT> -U <USER>:<PASSWORD> <TARGET_URL>

License

This source code is governed by a MIT license that can be found in the LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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