A JSON file is a way to store information on a computer. It stands for “JavaScript Object Notation.” Just like a toy box can hold many different toys, a JSON file can hold many different pieces of information. These pieces of information can be words, numbers, or even true or false.
A JSON file is a file that stores simple data structures and objects in JavaScript Object Notation (JSON) format, which is a standard data interchange format. It is primarily used to transmit data between a server and a web application, as an alternative to XML.
Here are some basic rules for creating a JSON file:
- JSON files must start and end with curly braces {}
- Data is represented as key-value pairs, separated by a colon :
- Each key-value pair must be separated by a comma ,
- Keys must be strings, enclosed in double quotes “”
- Values can be strings, numbers, booleans, objects, or arrays.
- Strings must be enclosed in double quotes “”
- Numbers do not have to be enclosed in quotes.
- Boolean values are true or false.
- Objects are enclosed in curly braces {} and can contain multiple key-value pairs.
- Arrays are enclosed in square brackets [] and can contain multiple values.
Example :
{
"name": "John Doe",
"age": 30,
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "AA",
"zip": "12345"
},
"phoneNumbers": [{
"type": "home",
"number": "555-555-5555"
}, {
"type": "work",
"number": "555-555-5556"
}]
}
Code language: JSON / JSON with Comments (json)
Note that, you can use tools like jsonlint.com to validate and check the json file you created. You can validate and format your config.json using Singbox commands.
I provided an explanation of the structure of the Sing-Box Config.JSON file to enable you to easily create your own config file.