一个最小可用的 Gin 服务:接收 trade_no/pid/key 等查询参数,调用本地 FlareSolverr 获取通过 Cloudflare 后的真实响应体,并把响应返回给调用方。
- Go(建议 1.20+)
- FlareSolverr(默认地址:
http://127.0.0.1:8191/v1)
PORT:服务端口,默认8080TARGET_URL:目标接口地址,默认https://credit.linux.do/epay/api.phpFLARESOLVERR_URL:FlareSolverr 地址,默认http://127.0.0.1:8191/v1MAX_TIMEOUT_MS:FlareSolverrmaxTimeout(毫秒),默认60000
查询订单状态。
认证:pid + key
| 参数 | 必填 | 说明 |
|---|---|---|
| act | 否 | 可选字段,建议 order(后端不强校验) |
| pid | 是 | Client ID |
| key | 是 | Client Secret |
| trade_no | 是 | 编号 |
| out_trade_no | 否 | 业务单号 |
| raw | 否 | 传 1/true 返回原始响应体(不提取/不解析) |
订单退款等 POST 操作。
编码:application/json 或 application/x-www-form-urlencoded
| 参数 | 必填 | 说明 |
|---|---|---|
| pid | 是 | Client ID |
| key | 是 | Client Secret |
| trade_no | 是 | 编号 |
| money | 是(退款时) | 退款金额,必须等于原积分流转服务的积分数量 |
| out_trade_no | 否 | 业务单号(兼容) |
| raw | 否 | URL 参数,传 1/true 返回原始响应体 |
cd gin-flaresolverr-proxy
go mod tidy
go run .cd gin-flaresolverr-proxy
# 可选:通过环境变量覆盖 FlareSolverr 地址(比如外部 FlareSolverr)
# export FLARESOLVERR_URL='http://127.0.0.1:8191/v1'
docker compose up -d --buildcd gin-flaresolverr-proxy
docker build -t gin-flaresolverr-proxy .
docker run --rm -p 8080:8080 \
-e FLARESOLVERR_URL='http://127.0.0.1:8191/v1' \
gin-flaresolverr-proxy- Workflow:
gin-flaresolverr-proxy/.github/workflows/docker.yml - 触发:push 到
main/master或打v*tag - 产物:推送到
ghcr.io/<owner>/<repo>(使用GITHUB_TOKEN)
curl 'http://127.0.0.1:8080/api?trade_no=011887340502908928&pid=...&key=...'curl 'http://127.0.0.1:8080/api?trade_no=011887340502908928&pid=...&key=...&raw=1'curl -X POST 'http://127.0.0.1:8080/api' \
-H 'Content-Type: application/json' \
-d '{"pid":"your_pid","key":"your_key","trade_no":"011887340502908928","money":"100"}'curl -X POST 'http://127.0.0.1:8080/api' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'pid=your_pid&key=your_key&trade_no=011887340502908928&money=100'