# Example

Along with the source code of the library, a small sample project is supplied, designed to test the functionality of the library. The source code of the project is in `<span style="color: #ba372a;">\liburl2cat\example</span>`

Also in this directory, you will find:

- grandbase.db - sample of a SafeDNS database;
- domains.csv - a file containing domains from the sample database
- url2cat.ini - a configuration file that specifies credentials for access to downloading and updating the database, updating paths, etc.

url2cat.ini file contains the following fields:

```INI
cache_size=0
db_name=grandbase.db
db_update_host=url2cat.safedns.com
db_update_path=/api/v1/update
db_download_path=/pubfilter/grandbase.db
db_update_user=username
db_update_password=password
db_user_version=00000000
server_host=x.api.safedns.com
server_path=/domain
server_user=username
server_password=password
recat_host=www.safedns.ru
recat_path=/api/json/v2
recat_user=username
recat_password=password
```

After configuration and assembly, the `<span style="color: #ba372a;">client</span>` file will appear in the `<span style="color: #ba372a;">/liburl2cat/build/bin</span>` directory. Move the following files from `<span style="color: #ba372a;">\liburl2cat\example</span>` to this directory:

- grandbase.db
- url2cat.ini

The client uses the domains.csv file as the source of domains/URLs for verification. You can create this file from the command line:

```shell
echo "facebook.com / /" >> domains.csv
```

To start the client, use `<span style="color: #ba372a;">./clent</span>` command.