SOCKS4, SOCKS4a and SOCKS5 proxy server in Go
This project is a fork of armon/go-socks5. The SOCKS5 implementation was written in that project. Thanks!
The package has the following features:
- "No Auth" mode
- User/Password authentication
- Support for the CONNECT command
- Rules to do granular filtering of commands
- Custom DNS resolution
- Unit tests
The package still needs the following:
- Support for the BIND command
- Support for the ASSOCIATE command
Below is a simple example of usage
socksConf := &socks.Config{}
socksServer, err := socks.New(socksConf)
if err != nil {
panic(err)
}
l, err := net.Listen("tcp", "127.0.0.1:1080")
if err != nil {
panic(err)
}
for {
conn, err := l.Accept()
if err != nil {
panic(err)
}
fmt.Println("accepted")
go socksServer.ServeConn(conn)
}