https://github.com/nwtgck/go-socks
SOCKS4, SOCKS4a and SOCKS5 proxy server in Go
https://github.com/nwtgck/go-socks
golang proxy-server socks-proxy socks4 socks4a socks5 socks5-proxy
Last synced: 4 months ago
JSON representation
SOCKS4, SOCKS4a and SOCKS5 proxy server in Go
- Host: GitHub
- URL: https://github.com/nwtgck/go-socks
- Owner: nwtgck
- License: mit
- Created: 2021-03-11T14:23:21.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2024-07-07T23:41:13.000Z (almost 2 years ago)
- Last Synced: 2025-04-01T08:52:05.396Z (about 1 year ago)
- Topics: golang, proxy-server, socks-proxy, socks4, socks4a, socks5, socks5-proxy
- Language: Go
- Homepage:
- Size: 76.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# go-socks
[](https://github.com/nwtgck/go-socks/actions/workflows/ci.yml)
SOCKS4, SOCKS4a and SOCKS5 proxy server in Go
## Thanks
This project is a fork of [armon/go-socks5](https://github.com/armon/go-socks5). The SOCKS5 implementation was written in that project. Thanks!
## 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
```go
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)
}
```