# agent-proxy **Repository Path**: github-29727412/agent-proxy ## Basic Information - **Project Name**: agent-proxy - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-05 - **Last Updated**: 2025-12-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # agent-proxy > 一个基于squid的agent代理服务,用户防止SSRF攻击,支持IP、域名白名单 ## 启动 ```bash docker run -d \ --name agent-proxy \ --restart unless-stopped \ -p 3128:3128 \ -p 8000:8000 \ agent-proxy:v1.0.0 docker compose -f ./docker-compose.yaml up -d ``` ## 使用 + k8s使用代理配置 ```yaml apiVersion: v1 kind: Pod metadata: name: example-pod spec: containers: env: - name: HTTP_PROXY value: "http://agent-proxy:3128" - name: HTTPS_PROXY value: "http://agent-proxy:3128" - name: NO_PROXY value: "localhost,127.0.0.1,.cluster.local" ``` + docker 使用代理配置 ```bash docker run -d \ --name [your-image] \ --restart unless-stopped \ -p 80:80 \ -e HTTPS_PROXY=http://localhost:3128 -e HTTP_PROXY=http://localhost:3128 -e NO_PROXY=localhost,127.0.0.1,.cluster.local [your-image]:v1.0.0 ``` 访问ui页面 http://localhost:8000/ui 获取squid 配置 http://localhost:8000/squid/config 接口控制 http://localhost:8000/squid/config/set 测试 域名,ip(多对多) ```bash curl -X POST -H "Content-Type: application/json" -d '{"data":{"domains":".baidu.com,npmjs.com","ips":"192.168.61.21,192.168.1.0/24,10.0.0.0/8,172.16.0.0/12","ports":"1025-65535"}}' http://localhost:8000/squid/config/set ``` 测试 域名/ip,端口(一对一) ```bash curl -X POST -H "Content-Type: application/json" -d '{"data":[{"domain":".baidu.com","port":"443","ip":""},{"ip":"192.168.61.21","domain":"","port":"80"}]}' http://localhost:8000/squid/config/set ``` ## 调试代理 ```bash curl -x http://localhost:3128 http://example.com ``` ## 打包 ```bash docker buildx build --provenance=false --platform linux/amd64,linux/arm64 -t agent-proxy:v1.0.0 -f ./Dockerfile . --push ```