https://github.com/esrrhs/socksfilter
socks5过滤器。socks5 server with filtering and forwarding
https://github.com/esrrhs/socksfilter
golang socks5-server
Last synced: 5 months ago
JSON representation
socks5过滤器。socks5 server with filtering and forwarding
- Host: GitHub
- URL: https://github.com/esrrhs/socksfilter
- Owner: esrrhs
- License: mit
- Created: 2020-09-25T12:14:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-09T12:35:21.000Z (9 months ago)
- Last Synced: 2025-08-09T14:32:08.867Z (9 months ago)
- Topics: golang, socks5-server
- Language: Go
- Homepage:
- Size: 1.89 MB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# socksfilter
[
](https://github.com/esrrhs/socksfilter)
[
](https://github.com/esrrhs/socksfilter)
[](https://goreportcard.com/report/github.com/esrrhs/socksfilter)
[
](https://github.com/esrrhs/socksfilter/releases)
[
](https://github.com/esrrhs/socksfilter/releases)
[
](https://hub.docker.com/repository/docker/esrrhs/socksfilter)
[
](https://github.com/esrrhs/socksfilter/actions)
socks5过滤器
# 特性
* 监听端口(默认1080),对外提供socks5服务,支持用户密码
* 使用阿里云DNS判断目标IP归属所在国家,内置LRU缓存减少查询
* 根据目标IP所在国家过滤(默认CN),命中直连,非命中走后端socks5 server
* 后端聚合多个socks5 server,选择方式:遍历(默认)/随机/Hash,同时跳过无效的
# 使用
* 监听本机1080端口,绕过CN地区,非CN地区,转发到后端的socks5 server
```
# ./socksfilter -s "yourserver1:1080 yourserver2:1080 yourserver3:1080"
```
* 也可以使用docker
```
# docker run --name socksfilter -d --restart=always --network host esrrhs/socksfilter ./socksfilter -s "yourserver1:1080 yourserver2:1080 yourserver3:1080"
```
* 更多命令参考-h
```
Usage of ./socksfilter:
-cache_expire int
cache expire seconds for dns (default 604800)
-cache_size int
cache size for dns (default 10000)
-file string
ip file (default "GeoLite2-Country.mmdb")
-l string
listen addr (default ":1080")
-loglevel string
log level (default "info")
-nolog int
write log file
-noprint int
print stdout
-password string
password
-s string
server addr (default "server1 server2 server3")
-select string
select server robin/rand/hash_by_dst_ip/hash_by_src_ip/hash_all (default "robin")
-skip string
skip country (default "CN")
-username string
username
```