Skip to content

realzhangliu/socks5-go

Repository files navigation

socks5-go 🎉

CircleCI Go Report Card

Inspired by go-socks5,This package provides full functionality of socks5 protocol.

The protocol described here is designed to provide a framework for client-server applications in both the TCP and UDP domains to conveniently and securely use the services of a network firewall.

Advantages👍

  • A painless host service
  • Support UDP ASSOCIATE (game network accelerator) SSTAP

Feature 🎯

The package has the following features:

  • "No Auth" mode
  • User/Password authentication mode
  • Support for the CONNECT command
  • Support for the BIND command(require the client to accept connections from the server,like FTP etc.)
  • Support for the UDP ASSOCIATE command
  • TCP connection optimize and copy buffer
  • UDP sessions management
  • UDP sessions timeout clearing mechanism missing
  • UDP session memory pool
  • Monitoring index (active connection count,traffic statistics,Delay statistics)
  • Unit tests

Download📶

Get the latest version on Release

Start with terminal😀

you may need to add run permission first

chmod +x socks5g-linux-amd64

Port only(No Auth)

./socks5g-linux-amd64 1080

Port and Username/Password

./socks5g-linux-amd64 1080 admin 123

Start with Docker 😘

modify the docker-compose.yml file, changing environment variables SOCKS5_PORT,SOCKS5_USER,SOCKS5_PASSWORD to the values you want.

docker-compose up -d

Example 👌

go get github.com/realzhangliu/socks5-go
package main

import (
	"github.com/realzhangliu/socks5-go"
	"log"
)

func main() {
	//var config socks5.Config
	//Implement yourself Config , default is provided.
	S5Server := socks5.NewSocks5Server(nil)
	log.Println(S5Server.Listen())
}