用 clash ,我是用的 `docker swarm` 集群,`7890` 就是代理端口,当代理服务用,clash 还支持分流啥的,很好用
`9090` 是控制端口,`
https://clash.razord.top/?host=127.0.0.1&port=9090#/proxies`,可以用来看日志和控制节点分流
再分享下 clash 的配置
https://github.com/juzisang/Rules/blob/main/clash.yaml```yaml
version: "3.9"
services:
clash-proxy:
image: metacubex/mihomo:v1.18.1
networks:
- cluster
environment:
- TZ=Asia/Shanghai
configs:
- source: clash_config
target: /root/.config/mihomo/config.yaml
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
# - ./config.yaml:/root/.config/clash/config.yaml
ports:
- target: 7890
published: 7890
protocol: tcp
mode: host
- target: 9090
published: 9090
protocol: tcp
mode: host
deploy:
replicas: 1
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
placement:
constraints:
- node.labels.type==cloud
configs:
clash_config:
file: ./config.yaml
networks:
cluster:
external: true
```