https://github.com/things-go/go-socks5
socks5 server in pure Golang with much custom optional. Full TCP/UDP and IPv4/IPv6 support.
https://github.com/things-go/go-socks5
socks5 socks5-client socks5-server
Last synced: 6 months ago
JSON representation
socks5 server in pure Golang with much custom optional. Full TCP/UDP and IPv4/IPv6 support.
- Host: GitHub
- URL: https://github.com/things-go/go-socks5
- Owner: things-go
- License: mit
- Created: 2020-04-19T06:05:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-24T03:19:59.000Z (6 months ago)
- Last Synced: 2025-04-24T04:20:35.565Z (6 months ago)
- Topics: socks5, socks5-client, socks5-server
- Language: Go
- Homepage:
- Size: 235 KB
- Stars: 458
- Watchers: 10
- Forks: 79
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-socks5
[](https://godoc.org/github.com/things-go/go-socks5)
[](https://pkg.go.dev/github.com/things-go/go-socks5?tab=doc)

[](https://codecov.io/gh/things-go/go-socks5)
[](https://goreportcard.com/report/github.com/things-go/go-socks5)
[](https://github.com/things-go/go-socks5/raw/master/LICENSE)
[](https://github.com/things-go/go-socks5/tags)Provides the `socks5` package that implements a [SOCKS5](http://en.wikipedia.org/wiki/SOCKS).
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:
- Support socks5 server
- Support TCP/UDP and IPv4/IPv6
- Unit tests
- "No Auth" mode
- User/Password authentication optional user addr limit
- Support for the CONNECT command
- Support for the ASSOCIATE command
- Rules to do granular filtering of commands
- Custom DNS resolution
- Custom goroutine pool
- buffer pool design and optional custom buffer pool
- Custom logger### TODO
The package still needs the following:
- Support for the BIND command### Installation
Use go get.
```bash
go get github.com/things-go/go-socks5
```Then import the socks5 server package into your own code.
```bash
import "github.com/things-go/go-socks5"
```### Example
Below is a simple example of usage, more see [example](https://github.com/things-go/go-socks5/tree/master/_example)
[embedmd]:# (_example/main.go go)
```go
package mainimport (
"log"
"os""github.com/things-go/go-socks5"
)func main() {
// Create a SOCKS5 server
server := socks5.NewServer(
socks5.WithLogger(socks5.NewLogger(log.New(os.Stdout, "socks5: ", log.LstdFlags))),
)// Create SOCKS5 proxy on localhost port 8000
if err := server.ListenAndServe("tcp", ":8000"); err != nil {
panic(err)
}
}
```### Reference
- [rfc1928](https://www.ietf.org/rfc/rfc1928.txt)
- original armon's [go-sock5](https://github.com/armon/go-socks5) library## License
This project is under MIT License. See the [LICENSE](LICENSE) file for the full license text.