https://github.com/nikandfor/socks5
socks5 proxy (client+server). Low-level, efficient, and extensible implementation.
https://github.com/nikandfor/socks5
client go golang proxy server
Last synced: 24 days ago
JSON representation
socks5 proxy (client+server). Low-level, efficient, and extensible implementation.
- Host: GitHub
- URL: https://github.com/nikandfor/socks5
- Owner: nikandfor
- License: mit
- Created: 2022-06-11T06:38:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-02-16T17:11:05.000Z (12 months ago)
- Last Synced: 2025-03-16T21:05:25.282Z (11 months ago)
- Topics: client, go, golang, proxy, server
- Language: Go
- Homepage:
- Size: 162 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/nikandfor/socks5?tab=doc)
[](https://github.com/nikandfor/socks5/actions/workflows/go.yml)
[](https://circleci.com/gh/nikandfor/socks5)
[](https://codecov.io/gh/nikandfor/socks5)
[](https://goreportcard.com/report/github.com/nikandfor/socks5)

# socks5
This is a library designed for performant multiproxy implementations. This means
* Efficient code
* Low-level API
* Stateless objects
* Both client and server is implemented
# Example
There is a [cmd/socks5/main.go](cmd/socks5/main.go) which can be treated as an example. It can also be used as a command.
```
go install nikand.dev/go/socks5/cmd/socks5@latest # install
socks5 server -l :1080 -auth user:pass,user2:pass # auth is optional, without it none auth is used
```
## Benchmarks
Generated on Apple Macbook Air M1
```
goos: darwin
goarch: arm64
pkg: nikand.dev/go/socks5
BenchmarkServerHandshake-8 36790387 32.39 ns/op 0 B/op 0 allocs/op
BenchmarkClientHandshake-8 56295850 21.05 ns/op 0 B/op 0 allocs/op
BenchmarkWriteRequest-8 37399100 32.51 ns/op 0 B/op 0 allocs/op
BenchmarkReadRequestName-8 16392350 71.46 ns/op 32 B/op 2 allocs/op
BenchmarkReadRequestIP16-8 22964949 53.26 ns/op 64 B/op 1 allocs/op
BenchmarkReadRequestNetipIP16-8 23116654 51.40 ns/op 32 B/op 1 allocs/op
```