Back to Sing Box

Introduction

docs/configuration/index.md

1.14.01.5 KB
Original Source

Introduction

sing-box uses JSON for configuration files.

Structure

json
{
  "$schema": "https://sing-box.sagernet.org/schema.json",
  "log": {},
  "dns": {},
  "ntp": {},
  "certificate": {},
  "certificate_providers": [],
  "http_clients": [],
  "network_namespaces": [],
  "endpoints": [],
  "inbounds": [],
  "outbounds": [],
  "route": {},
  "services": [],
  "experimental": {}
}

Fields

KeyFormat
$schemaJSON Schema
logLog
dnsDNS
ntpNTP
certificateCertificate
certificate_providersCertificate Provider
http_clientsHTTP Client
network_namespacesNetwork Namespace
endpointsEndpoint
inboundsInbound
outboundsOutbound
routeRoute
servicesService
experimentalExperimental

Check

bash
sing-box check

Format

bash
sing-box format -w -c config.json -D config_directory

Merge

bash
sing-box merge output.json -c config.json -D config_directory