Go to file
mo 32060b0332 fix head bug
add udp experimental handle
2020-04-20 12:39:01 +08:00
_example fix bug and add head to request 2020-04-19 23:40:14 +08:00
.github/workflows add go mod 2020-04-19 17:08:22 +08:00
.gitignore add go mod 2020-04-19 17:08:22 +08:00
.travis.yml add go mod 2020-04-19 17:08:22 +08:00
auth_test.go Introduce AuthContext struct and refactor auth api using it 2016-01-11 20:52:06 +13:00
auth.go Introduce AuthContext struct and refactor auth api using it 2016-01-11 20:52:06 +13:00
credentials_test.go Adding credentials test 2014-01-23 11:12:28 -08:00
credentials.go Adding simple credentials interface 2014-01-23 11:10:54 -08:00
go.mod add go mod 2020-04-19 17:08:22 +08:00
go.sum add head file 2020-04-19 21:37:05 +08:00
header.go fix head bug 2020-04-20 12:39:01 +08:00
LICENSE Initial commit 2014-01-22 15:49:51 -08:00
logger.go use logger interface 2020-04-19 17:47:39 +08:00
pool_test.go fix socks test pool bug 2020-04-20 09:50:49 +08:00
pool.go add buffer pool 2020-04-20 09:41:06 +08:00
README.md add original reference 2020-04-19 17:13:57 +08:00
request_test.go fix socks test pool bug 2020-04-20 09:50:49 +08:00
request.go fix head bug 2020-04-20 12:39:01 +08:00
resolver_test.go add go mod 2020-04-19 17:08:22 +08:00
resolver.go add go mod 2020-04-19 17:08:22 +08:00
ruleset_test.go fix bug and add head to request 2020-04-19 23:40:14 +08:00
ruleset.go add go mod 2020-04-19 17:08:22 +08:00
socks5_test.go use logger interface 2020-04-19 17:47:39 +08:00
socks5.go add buffer pool 2020-04-20 09:41:06 +08:00

go-socks5

Build Status codecov Action Status Go Report Card License

Provides the socks5 package that implements a SOCKS5 server. SOCKS (Secure Sockets) is used to route traffic between a client and server through an intermediate proxy layer. This can be used to bypass firewalls or NATs.

Feature

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

TODO

The package still needs the following:

  • Support for the BIND command
  • Support for the ASSOCIATE command

Example

Below is a simple example of usage

// Create a SOCKS5 server
conf := &socks5.Config{}
server, err := socks5.New(conf)
if err != nil {
  panic(err)
}

// Create SOCKS5 proxy on localhost port 8000
if err := server.ListenAndServe("tcp", "127.0.0.1:8000"); err != nil {
  panic(err)
}

Reference

original armon go-sock5 go-sock5