Skip to content

πŸ› οΈ hix.json Configuration

All HIX configuration lives in a single hix.json file located alongside the server executable. It works the same for using HIX in basic mode (programmatic routes, manual templates) as for HixStyle mode (MVC engine, loaders, views, controllers).


Column convention

In the master table each parameter has two environment-marking columns:

Column Meaning
Basic Affects the server in basic HIX mode (programmatic Harbour routes + static files)
HixStyle Affects the server in HixStyle mode (enabled = true)

βœ… = the parameter is relevant in that environment. ❌ = the parameter has no effect or is not used in that environment.

The keys marked only under HixStyle are:

  • The entire hixstyle section

The rest affects both environments equally.


Master parameter table

Section Key Default Basic HixStyle Description
server host localhost βœ… βœ… Listen interface. 0.0.0.0 = all. localhost = local only.
server port 80 βœ… βœ… TCP port. Ports < 1024 require admin/root.
server maxconn 1024 βœ… βœ… Maximum simultaneous connections.
server timeout 30 βœ… βœ… Connection timeout (seconds).
server name HIX/2.1 βœ… βœ… HTTP header value Server:.
server mode standalone βœ… βœ… standalone or proxied (behind nginx/Apache).
server trusted_proxies 127.0.0.1 ::1 βœ… βœ… Trusted IPs/CIDR, space-separated (mode=proxied).
server ssl false βœ… βœ… Enables TLS. Requires cert_private + cert_public.
server cert_private "" βœ… βœ… Private key filename .key (inside paths.certs).
server cert_public "" βœ… βœ… Certificate filename .crt (inside paths.certs).
server gzip true βœ… βœ… Compresses HTTP responses.
server gzip_min_size 2048 βœ… βœ… Minimum body size to compress (bytes).
server autostart true βœ… βœ… Opens the browser at the server URL on startup.
server exec_timeout_ms 30000 βœ… βœ… Maximum execution time for .prg/.hrb (ms). 0 = no limit.
paths root www βœ… βœ… Document root.
paths log .logs βœ… βœ… Logs directory.
paths tmp tmp βœ… βœ… Temp files (uploads, transpiles).
paths errors .logs βœ… βœ… Custom HTTP error pages.
paths session .sessions βœ… βœ… Session storage (storage=file).
paths certs certs βœ… βœ… SSL/TLS certificates directory.
app errorsys "" βœ… βœ… HTML template for the errorsys screen (relative to root/). Empty = use built-in.
app default_page index.html βœ… βœ… Default resource when the URL has no file.
app dispatch_mode full βœ… βœ… routes (programmatic only) / static (+ files) / full (+ prg/hrb).
app auto_close_dbf true βœ… βœ… Closes open DBFs at the end of the request.
app auto_close_dbf_log false βœ… βœ… Logs every auto-close of DBF.
app env dev βœ… βœ… dev (detailed errors) / prod (generic errors).
app debug false βœ… βœ… true = DEBUG level to console.
admin enabled true βœ… βœ… false = disables the admin panel and all /hix-* routes.
admin user "" βœ… βœ… Admin user.
admin password "" βœ… βœ… MD5 hash of the password. Empty = shows /hix-setup.
admin secret "" βœ… βœ… Cookie signing key, auto-generated by /hix-setup.
detector workers 4 βœ… βœ… Workers that detect protocol on each new connection.
detector queue_size 256 βœ… βœ… Internal queue.
detector peek_timeout_ms 100 βœ… βœ… Maximum wait for first byte. LAN=10, internet=50.
detector peek_bytes 512 βœ… βœ… Bytes to read to identify the protocol.
pool_http workers 64 βœ… βœ… HTTP workers (~1MB stack/thread on Windows).
pool_http queue_size 256 βœ… βœ… Queue of pending requests.
pool_http read_timeout_ms 2000 βœ… βœ… HTTP header read timeout (ms).
pool_http keep_alive true βœ… βœ… Enables HTTP Keep-Alive.
pool_http keep_alive_max 100 βœ… βœ… Maximum requests per keep-alive connection.
pool_ws workers 100 βœ… βœ… WebSocket workers. Each active WS uses 1 worker until closed.
pool_ws queue_size 256 βœ… βœ… Queue of pending connections.
pool_ws ping_interval_s 30 βœ… βœ… Client ping interval (seconds).
pool_ws ping_timeout_s 10 βœ… βœ… Ping response timeout (seconds).
pool_rest workers_sse 20 βœ… βœ… Workers for Server-Sent Events (each SSE takes 1).
pool_rest workers_longpoll 10 βœ… βœ… Workers for Long Polling.
pool_rest queue_size 128 βœ… βœ… Shared queue.
pool_rest stream_timeout_s 3600 βœ… βœ… Maximum duration of an open stream (seconds).
pool_hix workers 4 βœ… βœ… Workers dedicated to the internal HIX channel.
pool_hix queue_size 64 βœ… βœ… HIX pool queue.
pool_hix read_timeout_ms 2000 βœ… βœ… Read timeout (ms).
session storage memory βœ… βœ… memory (volatile, fast) / file (persistent).
session prefix sess_ βœ… βœ… Session file name prefix.
session crypt false βœ… βœ… Encrypts session data on disk.
session seed "" βœ… βœ… Encryption key (required if crypt=true).
session lifetime 60 βœ… βœ… Session lifetime in minutes (applies to user and admin cookie). 0 = unlimited.
session gc_days 3 βœ… βœ… Days for GC of orphaned session files (only storage=file).
monitor enabled true βœ… βœ… Enables the health monitor thread.
monitor interval_s 5 βœ… βœ… Check interval (seconds).
monitor alert_pct 75 βœ… βœ… % queue usage that triggers the SATURATED alert.
log file hix.log βœ… βœ… Log filename (path = paths.log).
log level info βœ… βœ… debug / info / warn / error / fatal.
log console true βœ… βœ… true = duplicates output to console.
log max_size_mb 10 βœ… βœ… Maximum size before rotation (MB).
log max_files 0 βœ… βœ… Maximum retained backups. 0 = unlimited.
access_log enabled true βœ… βœ… Enables the HTTP access log (Common Log Format).
access_log file access.log βœ… βœ… Access log filename (path = paths.log).
firewall mode blacklist βœ… βœ… blacklist (blocks listed) / whitelist (listed only).
firewall filter "" βœ… βœ… Comma-separated list of IP/CIDR. E.g.: 192.168.1.0/24, 10.0.0.0/8.
hixstyle enabled false ❌ βœ… Enables the MVC HixStyle engine.
hixstyle cache_disk true ❌ βœ… Caches compiled views to disk (.cached/views/).
hixstyle trace false ❌ βœ… Enables HixStyle trace in the log.
hixstyle cache_ram false ❌ βœ… Global view cache in shared RAM across workers. ~10Γ— faster than disk.
trace app true βœ… βœ… Trace of module app.
trace server true βœ… βœ… Trace of module server.
trace worker_http false βœ… βœ… Trace of HTTP worker.
trace worker_ws false βœ… βœ… Trace of WebSocket worker.
trace worker_otros false βœ… βœ… Trace of SSE/LongPoll worker.
trace pool false βœ… βœ… Trace of pools.
trace pool_detector false βœ… βœ… Trace of protocol detector.
trace metrics false βœ… βœ… Trace of metrics module.
trace config false βœ… βœ… Trace of configuration loading.
trace socket false βœ… βœ… Trace of socket operations.
trace monitor false βœ… βœ… Trace of monitor.
trace response false βœ… βœ… Trace of response module.
trace logger false βœ… βœ… Trace of the logger itself.
trace error false βœ… βœ… Trace of errors.

Hot-toggle trace: GET /hix-trace?mod=<module>&on=1. WARN/ERROR/FATAL are always logged, regardless of trace.


Section summary

server - network and identity

Defines how the server listens: interface, port, TLS, and mode (standalone or behind a proxy). Set before the first production startup.

paths - disk layout

Server root structure. Change if you want to relocate www/, logs, or sessions to another drive.

app - application

errorsys template for the system error screen, env (dev/prod), debug, dispatcher, execution timeout, default page. Custom error pages live in the fixed folder <paths.root>/errors/. The file <paths.root>/config.json (optional) and the folder <paths.root>/loaders/ (optional) are loaded automatically if they exist.

admin - /hix-* panel

Admin panel credentials. If you leave password empty, the first access to /hix-setup sets it up. enabled = false turns off all /hix-* routes.

detector, pool_http, pool_ws, pool_rest, pool_hix - concurrency

Pool and queue sizes. Defaults handle medium traffic; adjust if the monitor reports saturation (SATURATED when the queue exceeds alert_pct).

session - HTTP sessions

memory is the fastest but is lost on restart. file persists but adds I/O. For multi-process always use file with seed.

monitor, log, access_log - observability

Main logger with rotation, CLF access log, and health monitor exposing /hix-status. See also: sistema/logger, sistema/metricas.

firewall - IP filtering

Whitelist or blacklist of IPs/CIDR. See hixstyle/seguridad/firewall.

hixstyle - MVC engine

Enables and tunes HixStyle. Applies only if enabled = true.

trace - per-module verbosity

Binary flags to enable traces for each core module. Useful for diagnosing specific problems without flooding the log.

Although many parameters are visible, this is just the definition of a web server's parameters. You should not change these parameters unless you know exactly what they do. Don't worry at first: everything is already configured.