Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xialeistudio/go-socks
golang socks5 server
https://github.com/xialeistudio/go-socks
golang socks5-proxy
Last synced: about 1 month ago
JSON representation
golang socks5 server
- Host: GitHub
- URL: https://github.com/xialeistudio/go-socks
- Owner: xialeistudio
- License: mit
- Created: 2019-08-17T07:46:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-17T07:47:20.000Z (over 5 years ago)
- Last Synced: 2024-06-20T14:26:08.432Z (7 months ago)
- Topics: golang, socks5-proxy
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# golang socks5服务器
基于net包开发,使用协程维持客户端连接代码量比较少,socks5协议也比较简单,可以作为TCP协议开发入门例子
## 安装
```bash
go get github.com/xialeistudio/go-socks
```## 使用
```go
package mainimport (
"github.com/xialeistudio/go-socks/socks5"
"github.com/xialeistudio/go-socks/socks5/authenticator"
"log"
)func main() {
accounts := map[string]string{
"username": "password",
}
authenticators := []socks5.Authenticator{
authenticator.NewNoneAuthenticator(), // 免密码认证
authenticator.NewUserPasswordAuthenticator(accounts), // 账号和密码认证
}
server := socks5.NewServer(authenticators, true)
log.Println(server.ListenAndServe("127.0.0.1", 10000))
}
```## 功能
1. 免认证/账号密码认证
2. 仅支持CONNECT命令## TODO
1. [ ] 支持ruleset
2. [ ] 支持BIND和UDP ASSOCIATE命令## 作者博客
[每天进步一点点](https://www.ddhigh.com)