https://github.com/tuankiri/socks5
A fully featured implementation of the SOCKS 5 protocol in golang. Command CONNECT ✅, BIND 🛠, UDP ASSOCIATE ✅.
https://github.com/tuankiri/socks5
bind connect go golang proxy socks socks5 socks5h tcp-proxy tls udp udp-associate udp-proxy
Last synced: about 1 month ago
JSON representation
A fully featured implementation of the SOCKS 5 protocol in golang. Command CONNECT ✅, BIND 🛠, UDP ASSOCIATE ✅.
- Host: GitHub
- URL: https://github.com/tuankiri/socks5
- Owner: TuanKiri
- License: mit
- Created: 2024-03-16T19:01:58.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-19T18:56:15.000Z (10 months ago)
- Last Synced: 2024-12-19T19:43:46.771Z (10 months ago)
- Topics: bind, connect, go, golang, proxy, socks, socks5, socks5h, tcp-proxy, tls, udp, udp-associate, udp-proxy
- Language: Go
- Homepage:
- Size: 73.2 KB
- Stars: 21
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
SOCKS 5
[](LICENSE)
[](go.mod)
[](https://pkg.go.dev/github.com/TuanKiri/socks5)
[](https://goreportcard.com/report/github.com/TuanKiri/socks5)
[](https://github.com/TuanKiri/socks5/actions?workflow=Test)[Report Bug](https://github.com/TuanKiri/socks5/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml&title=%5BBug%5D%3A+) | [Request Feature](https://github.com/TuanKiri/socks5/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml&title=%5BEnhancement%5D%3A+)
A fully featured implementation of the SOCKS 5 protocol in golang.
| CONNECT | BIND | UDP ASSOCIATE |
| :--------------: | :-------------: | :--------------: |
| ✅ - implemented | 🛠 - in progress | ✅ - implemented |
## Installation
go get github.com/TuanKiri/socks5
## Getting Started
Create your `.go` file. For example: `main.go`.
```go
package mainimport (
"context"
"log"
"os/signal"
"syscall""github.com/TuanKiri/socks5"
)func main() {
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()srv := socks5.New()
go func() {
if err := srv.ListenAndServe(); err != nil {
log.Fatal(err)
}
}()<-ctx.Done()
if err := srv.Shutdown(); err != nil {
log.Fatal(err)
}
}
```Run your server:
go run main.go
The following curl example shows how to use the proxy server:
curl -x socks5://127.0.0.1:1080 http://example.com
See the [tests](socks5_test.go) and [examples](examples) for more information about package.
## FAQ
- Why can't connect to socks proxy server?
Not all applications and browsers support socks authentication or socks protocol. You may need [extension](https://github.com/txthinking/socks5-configurator) for Chrome or another browser.
If you have any questions, you can ask in [GitHub Discussions](https://github.com/TuanKiri/socks5/discussions/new?category=q-a).
## Note
- The proof of work for the UDP association was done using [qBittorrent](https://github.com/qbittorrent/qBittorrent) - a BitTorrent client.
## Contributing
Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
Please follow the [contribution guidelines](.github/CONTRIBUTING.md).
## References
- [RFC 1928](https://www.rfc-editor.org/rfc/rfc1928.txt) SOCKS Protocol Version 5
- [RFC 1929](https://www.rfc-editor.org/rfc/rfc1929.txt) Username/Password Authentication for SOCKS V5## Licenses
- All source code is licensed under the [MIT License](LICENSE).
- Logo is based on the Go Gopher mascot originally designed by [Egon Elbre](https://github.com/egonelbre/gophers) and which is also licensed under the [CC0 1.0 Universal License](https://creativecommons.org/publicdomain/zero/1.0/).