Config

get
获得当前的基础设置

/configs
Request
Response
200: OK
{
"port": 7890,
"socket-port": 7891,
"redir-port": 0,
"allow-lan": true,
"mode": "Rule",
"log-level": "info"
}

patch
增量修改配置

/configs
传入需要修改的配置即可
Request
Response
Body Parameters
port
optional
integer
HTTP 代理端口
socks-port
optional
integer
Socks5 代理端口
redir-port
optional
string
Redir 代理端口
allow-lan
optional
boolean
是否把代理监听地址放到 0.0.0.0
mode
optional
string
代理模式 ( Global | Rule | Direct )
log-level
optional
string
设置 TTY 日志等级 ( info | warning | error | debug )
204: No Content
由于可能出现 RESTful API 流量经过代理的问题,而更换端口需要 Graceful Shutdown 所以统一返回 204 No Content

put
重新加载配置文件

/configs
这个接口不会影响 external-controller 和 secret 的值
Request
Response
Query Parameters
force
optional
boolean
改变端口等信息
Body Parameters
path
optional
string
配置文件完整路径
200: OK

get
获取所有已经解析的规则

/rules
Request
Response
200: OK
{
"rules": [
{ "type": "DomainSuffix", "payload": "google.com", "proxy": "Proxy" },
{ "type": "DomainKeyword", "payload": "google", "proxy": "Proxy" },
{ "type": "GEOIP", "payload": "CN", "proxy": "DIRECT" },
{ "type": "IPCIDR", "payload": "91.108.4.0/22", "proxy": "Proxy" },
{ "type": "FINAL", "payload": "", "proxy": "Proxy" }
]
}