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.
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
Get the latest version on Release
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
modify the docker-compose.yml file, changing environment variables SOCKS5_PORT,SOCKS5_USER,SOCKS5_PASSWORD to the values you want.
docker-compose up -d
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())
}