sing-box/docs/configuration/experimental/index.md

108 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2022-08-25 21:08:29 +08:00
# Experimental
2022-07-20 07:36:06 +08:00
### Structure
```json
{
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9090",
"external_ui": "folder",
2022-09-10 22:42:20 +08:00
"secret": "",
"default_mode": "rule",
"store_selected": false,
"cache_file": "cache.db"
2022-10-01 11:48:46 +08:00
},
"v2ray_api": {
"listen": "127.0.0.1:8080",
"stats": {
"enabled": true,
"inbounds": [
"socks-in"
],
"outbounds": [
"proxy",
"direct"
2023-02-08 16:50:15 +08:00
],
"users": [
"sekai"
2022-10-01 11:48:46 +08:00
]
}
2022-07-20 07:36:06 +08:00
}
}
}
```
2022-10-01 11:48:46 +08:00
!!! note ""
Traffic statistics and connection management can degrade performance.
2022-07-20 07:36:06 +08:00
### Clash API Fields
!!! error ""
2022-08-23 23:15:56 +08:00
Clash API is not included by default, see [Installation](/#installation).
2022-07-20 07:36:06 +08:00
#### external_controller
2022-09-10 22:42:20 +08:00
RESTful web API listening address. Clash API will be disabled if empty.
2022-07-20 07:36:06 +08:00
#### external_ui
A relative path to the configuration directory or an absolute path to a
directory in which you put some static web resource. sing-box will then
2022-07-20 07:36:06 +08:00
serve it at `http://{{external-controller}}/ui`.
#### secret
Secret for the RESTful API (optional)
Authenticate by spedifying HTTP header `Authorization: Bearer ${secret}`
2022-09-10 22:42:20 +08:00
ALWAYS set a secret if RESTful API is listening on 0.0.0.0
#### default_mode
Default mode in clash, `rule` will be used if empty.
This setting has no direct effect, but can be used in routing and DNS rules via the `clash_mode` rule item.
#### store_selected
!!! note ""
The tag must be set for target outbounds.
Store selected outbound for the `Selector` outbound in cache file.
#### cache_file
2022-10-01 11:48:46 +08:00
Cache file path, `cache.db` will be used if empty.
### V2Ray API Fields
!!! error ""
V2Ray API is not included by default, see [Installation](/#installation).
#### listen
gRPC API listening address. V2Ray API will be disabled if empty.
#### stats
Traffic statistics service settings.
#### stats.enabled
Enable statistics service.
#### stats.inbounds
Inbound list to count traffic.
#### stats.outbounds
Outbound list to count traffic.
2023-02-08 16:50:15 +08:00
#### stats.users
User list to count traffic.