HIX - Harbour web server

967 views
Skip to first unread message

Charly 9000

unread,
Aug 7, 2026, 5:28:23 AMAug 7
to Harbour Users
Hi, 

After several months, I think he's mature enough to be released.

HIX is a web server based on Harbour. I've refactored everything and it's available in this repository, open source.

https://github.com/carles9000/hix

In the repo, I've included a couple of web service examples and a simple CRUD application for you to experiment with.

Harbour Forever.

C.


Message has been deleted

hmpaquito

unread,
Aug 7, 2026, 6:03:12 AMAug 7
to Harbour Users
Charly,

Revisando la docu, se nota que te lo has currado. Se nota la profesionalidad y el saber hacer con el que está hecho. 

Congrats !

poopall

unread,
Aug 10, 2026, 12:21:58 AMAug 10
to Harbour Users
Sorry I could not immediatly see which platform this runs one, Windows or Linux ??

Itamar Lins

unread,
Aug 11, 2026, 3:10:37 PMAug 11
to Harbour Users
Hi!

Generating C source output to '.hbmk/gcc/server/hix_lang_es.c'... Done.
 hbmk2: Compiling... src/hix_server.prg:1268:10: fatal error: Windows.h:
No such file or directory compilation terminated. hbmk2[hix_server]:
 Error: Running C/C++ compiler. 1

On Linux OS, I use this FIX, file \source\hix_lang_es.c
// --------------------------------------------------------- //
#pragma BEGINDUMP

#include <stdio.h>
#include <string.h>

// If compiling on Windows, define the macro to prevent MSVC compiler warnings/errors about unsafe functions
#if defined(_WIN32) || defined(_WIN64) || defined(__WINDOWS__)
   #if !defined(_CRT_SECURE_NO_WARNINGS)
      #define _CRT_SECURE_NO_WARNINGS
   #endif
#else
   // If compiling on Linux/POSIX, map the Windows-specific secure functions to standard ANSI C
   #define sscanf_s sscanf
#endif

#include <hbapi.h>
#include <hbapiitm.h>

HB_FUNC( HIX_DATECOMPILE )
{
   char *pszVersion = (char *) hb_xgrab( 80 );
   char szDate[12] = {0};
   char szTime[9] = {0};
   int year, month = 0, day, hour, minute;
   const char *months[] = {
      "Jan", "Feb", "Mar", "Apr", "May", "Jun",
      "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
   };

   // snprintf is native, secure, and cross-platform on both systems
   snprintf( szDate, sizeof(szDate), "%s", __DATE__ );
   snprintf( szTime, sizeof(szTime), "%s", __TIME__ );

   // sscanf_s will be translated to standard sscanf only when compiling on Linux
   sscanf_s( szDate + 7, "%d", &year );
   sscanf_s( szDate + 4, "%d", &day );

   for( month = 0; month < 12; ++month )
   {
      if( strncmp( szDate, months[month], 3 ) == 0 )
         break;
   }
   month += 1;

   sscanf_s( szTime, "%d:%d", &hour, &minute );

   // Format into the target version pattern (rYYMMDDHHMM)
   hb_snprintf( pszVersion, 80, "(r%02d%02d%02d%02d%02d)", year % 100, month, day, hour, minute );

   hb_retc_buffer( pszVersion );
}

#pragma ENDDUMP

a
itamar@itamar-I7:~/dev/hix$ hbmk2 hix_server.hbp hbssl.hbc -rebuild
hbmk2: Harbour: Compilando módulos...
Harbour 3.2.1dev (r2607071005)
Copyright (c) 1999-2025, https://harbour.github.io/
Compiling 'src/hix_trace.prg'...
Lines 341, Functions/Procedures 11
Generating C source output to '.hbmk/gcc/server/hix_trace.c'... Done.
Compiling 'src/hix_logger.prg'...
Lines 1633, Functions/Procedures 16
Generating C source output to '.hbmk/gcc/server/hix_logger.c'... Done.
Compiling 'src/hix_data_pool.prg'...
Lines 237, Functions/Procedures 18
Generating C source output to '.hbmk/gcc/server/hix_data_pool.c'... Done.
Compiling 'src/hix_bootlog.prg'...
Lines 1594, Functions/Procedures 10
Generating C source output to '.hbmk/gcc/server/hix_bootlog.c'... Done.
Compiling 'src/hix_gzip.prg'...
Lines 1426, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_gzip.c'... Done.
Compiling 'src/hix_accesslog.prg'...
Lines 263, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_accesslog.c'... Done.
Compiling 'src/hix_echo.prg'...
Lines 204, Functions/Procedures 8
Generating C source output to '.hbmk/gcc/server/hix_echo.c'... Done.
Compiling 'src/hix_config.prg'...
Lines 340, Functions/Procedures 6
Generating C source output to '.hbmk/gcc/server/hix_config.c'... Done.
Compiling 'src/hix_config_data.prg'...
Lines 581, Functions/Procedures 6
Generating C source output to '.hbmk/gcc/server/hix_config_data.c'... Done.
Compiling 'src/hix_config_app.prg'...
Lines 1745, Functions/Procedures 9
Generating C source output to '.hbmk/gcc/server/hix_config_app.c'... Done.
Compiling 'src/hix_keys.prg'...
Lines 1436, Functions/Procedures 6
Generating C source output to '.hbmk/gcc/server/hix_keys.c'... Done.
Compiling 'src/hix_metrics.prg'...
Lines 1757, Functions/Procedures 26
Generating C source output to '.hbmk/gcc/server/hix_metrics.c'... Done.
Compiling 'src/hix_error.prg'...
Lines 2418, Functions/Procedures 24
Generating C source output to '.hbmk/gcc/server/hix_error.c'... Done.
Compiling 'src/hix_socket.prg'...
Lines 1410, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_socket.c'... Done.
Compiling 'src/hix_ip.prg'...
Lines 288, Functions/Procedures 7
Generating C source output to '.hbmk/gcc/server/hix_ip.c'... Done.
Compiling 'src/hix_firewall.prg'...
Lines 627, Functions/Procedures 20
Generating C source output to '.hbmk/gcc/server/hix_firewall.c'... Done.
Compiling 'src/hix_proxy.prg'...
Lines 138, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_proxy.c'... Done.
Compiling 'src/hix_response.prg'...
Lines 1543, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_response.c'... Done.
Compiling 'src/hix_pool.prg'...
Lines 1779, Functions/Procedures 12
Generating C source output to '.hbmk/gcc/server/hix_pool.c'... Done.
Compiling 'src/hix_io.prg'...
Lines 2288, Functions/Procedures 19
Generating C source output to '.hbmk/gcc/server/hix_io.c'... Done.
Compiling 'src/hix_multipart.prg'...
Lines 1561, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_multipart.c'... Done.
Compiling 'src/hix_request.prg'...
Lines 2254, Functions/Procedures 43
Generating C source output to '.hbmk/gcc/server/hix_request.c'... Done.
Compiling 'src/hix_context.prg'...
Lines 1436, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_context.c'... Done.
Compiling 'src/hix_middleware.prg'...
Lines 2249, Functions/Procedures 9
Generating C source output to '.hbmk/gcc/server/hix_middleware.c'... Done.
Compiling 'src/hix_jwt.prg'...
Lines 1657, Functions/Procedures 9
Generating C source output to '.hbmk/gcc/server/hix_jwt.c'... Done.
Compiling 'src/mw/hix_mw_cors.prg'...
Lines 1571, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_mw_cors.c'... Done.
Compiling 'src/mw/hix_mw_jwt.prg'...
Lines 1639, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_mw_jwt.c'... Done.
Compiling 'src/mw/hix_mw_ratelimit.prg'...
Lines 1641, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_mw_ratelimit.c'... Done.
Compiling 'src/mw/hix_mw_secheaders.prg'...
Lines 1574, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_mw_secheaders.c'... Done.
Compiling 'src/mw/hix_mw_apikey.prg'...
Lines 1597, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_mw_apikey.c'... Done.
Compiling 'src/mw/hix_mw_reqlog.prg'...
Lines 1566, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_mw_reqlog.c'... Done.
Compiling 'src/mw/hix_mw_maintenance.prg'...
Lines 1581, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_mw_maintenance.c'... Done.
Compiling 'src/mw/hix_mw_bodylimit.prg'...
Lines 1572, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_mw_bodylimit.c'... Done.
Compiling 'src/mw/hix_mw_methodfilter.prg'...
Lines 1597, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_mw_methodfilter.c'... Done.
Compiling 'src/mw/hix_mw_anomaly.prg'...
Lines 1691, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_mw_anomaly.c'... Done.
Compiling 'src/mw/hix_mw_auth.prg'...
Lines 1875, Functions/Procedures 13
Generating C source output to '.hbmk/gcc/server/hix_mw_auth.c'... Done.
Compiling 'src/mw/hix_mw_session_auth.prg'...
Lines 1413, Functions/Procedures 2
Generating C source output to '.hbmk/gcc/server/hix_mw_session_auth.c'... Done.
Compiling 'src/hix_token.prg'...
Lines 115, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_token.c'... Done.
Compiling 'src/hix_csrf.prg'...
Lines 50, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_csrf.c'... Done.
Compiling 'src/hix_resource.prg'...
Lines 1259, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_resource.c'... Done.
Compiling 'src/mw/hix_mw_csrf.prg'...
Lines 1705, Functions/Procedures 5
Generating C source output to '.hbmk/gcc/server/hix_mw_csrf.c'... Done.
Compiling 'src/mw/hix_mw_web_session.prg'...
Lines 1197, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_mw_web_session.c'... Done.
Compiling 'src/mw/hix_mw_web_auth.prg'...
Lines 1196, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_mw_web_auth.c'... Done.
Compiling 'src/mw/hix_mw_web_edit.prg'...
Lines 1201, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_mw_web_edit.c'... Done.
Compiling 'src/mw/hix_mw_web_admin.prg'...
Lines 1201, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_mw_web_admin.c'... Done.
Compiling 'src/mw/hix_mw_api_jwt.prg'...
Lines 1206, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_mw_api_jwt.c'... Done.
Compiling 'src/mw/hix_mw_api_admin.prg'...
Lines 1210, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_mw_api_admin.c'... Done.
Compiling 'src/hix_mw_loader.prg'...
Lines 1930, Functions/Procedures 14
Generating C source output to '.hbmk/gcc/server/hix_mw_loader.c'... Done.
Compiling 'src/hix_loader.prg'...
Lines 1957, Functions/Procedures 10
Generating C source output to '.hbmk/gcc/server/hix_loader.c'... Done.
Compiling 'src/hix_session.prg'...
Lines 1973, Functions/Procedures 19
Generating C source output to '.hbmk/gcc/server/hix_session.c'... Done.
Compiling 'src/hix_admin.prg'...
Lines 1889, Functions/Procedures 13
Generating C source output to '.hbmk/gcc/server/hix_admin.c'... Done.
Compiling 'src/hix_router.prg'...
Lines 3109, Functions/Procedures 38
Generating C source output to '.hbmk/gcc/server/hix_router.c'... Done.
Compiling 'src/hix_dispatcher.prg'...
Lines 3297, Functions/Procedures 40
Generating C source output to '.hbmk/gcc/server/hix_dispatcher.c'... Done.
Compiling 'src/hix_worker_http.prg'...
Lines 1534, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_worker_http.c'... Done.
Compiling 'src/hix_worker_ws.prg'...
Lines 1743, Functions/Procedures 17
Generating C source output to '.hbmk/gcc/server/hix_worker_ws.c'... Done.
Compiling 'src/hix_longpoll.prg'...
Lines 1496, Functions/Procedures 6
Generating C source output to '.hbmk/gcc/server/hix_longpoll.c'... Done.
Compiling 'src/hix_sse.prg'...
Lines 1525, Functions/Procedures 7
Generating C source output to '.hbmk/gcc/server/hix_sse.c'... Done.
Compiling 'src/hix_worker_otros.prg'...
Lines 1474, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_worker_otros.c'... Done.
Compiling 'src/hix_zombie.prg'...
Lines 1509, Functions/Procedures 7
Generating C source output to '.hbmk/gcc/server/hix_zombie.c'... Done.
Compiling 'src/hix_block.prg'...
Lines 1188, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_block.c'... Done.
Compiling 'src/hix_prepro.prg'...
Lines 1804, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_prepro.c'... Done.
Compiling 'src/hix_helpers.prg'...
Lines 2071, Functions/Procedures 61
Generating C source output to '.hbmk/gcc/server/hix_helpers.c'... Done.
Compiling 'src/hix_server.prg'...
Lines 3151, Functions/Procedures 44
Generating C source output to '.hbmk/gcc/server/hix_server.c'... Done.
Compiling 'src/hix_monitor.prg'...
Lines 1495, Functions/Procedures 4
Generating C source output to '.hbmk/gcc/server/hix_monitor.c'... Done.
Compiling 'src/hix_view_viewer.prg'...
Lines 3178, Functions/Procedures 16
Generating C source output to '.hbmk/gcc/server/hix_view_viewer.c'... Done.
Compiling 'src/hix_view_params.prg'...
Lines 2172, Functions/Procedures 8
Generating C source output to '.hbmk/gcc/server/hix_view_params.c'... Done.
Compiling 'src/hix_view_tools.prg'...
Lines 136, Functions/Procedures 7
Generating C source output to '.hbmk/gcc/server/hix_view_tools.c'... Done.
Compiling 'src/hix_view_parser.prg'...
Lines 4289, Functions/Procedures 35
Generating C source output to '.hbmk/gcc/server/hix_view_parser.c'... Done.
Compiling 'src/hix_view_transpile.prg'...
Lines 3268, Functions/Procedures 20
Generating C source output to '.hbmk/gcc/server/hix_view_transpile.c'... Done.
Compiling 'src/hix_errorsys.prg'...
Lines 1615, Functions/Procedures 8
Generating C source output to '.hbmk/gcc/server/hix_errorsys.c'... Done.
Compiling 'src/hix_view.prg'...
Lines 1356, Functions/Procedures 7
Generating C source output to '.hbmk/gcc/server/hix_view.c'... Done.
Compiling 'src/hix_view_support.prg'...
Lines 102, Functions/Procedures 2
Generating C source output to '.hbmk/gcc/server/hix_view_support.c'... Done.
Compiling 'src/hix_flash.prg'...
Lines 910, Functions/Procedures 11
Generating C source output to '.hbmk/gcc/server/hix_flash.c'... Done.
Compiling 'src/hix_validator.prg'...
Lines 2290, Functions/Procedures 24
Generating C source output to '.hbmk/gcc/server/hix_validator.c'... Done.
Compiling 'src/validator/hix_val_cast.prg'...
Lines 121, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_val_cast.c'... Done.
Compiling 'src/validator/hix_val_rules.prg'...
Lines 390, Functions/Procedures 9
Generating C source output to '.hbmk/gcc/server/hix_val_rules.c'... Done.
Compiling 'src/validator/hix_val_sanitize.prg'...
Lines 135, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_val_sanitize.c'... Done.
Compiling 'src/validator/hix_val_helpers.prg'...
Lines 177, Functions/Procedures 11
Generating C source output to '.hbmk/gcc/server/hix_val_helpers.c'... Done.
Compiling 'src/dbf/hix_dbf.prg'...
Lines 3239, Functions/Procedures 28
Generating C source output to '.hbmk/gcc/server/hix_dbf.c'... Done.
Compiling 'src/pdf/tpdf.prg'...
Lines 2473, Functions/Procedures 40
Generating C source output to '.hbmk/gcc/server/tpdf.c'... Done.
Compiling 'src/lang/hix_lang.prg'...
Lines 195, Functions/Procedures 3
Generating C source output to '.hbmk/gcc/server/hix_lang.c'... Done.
Compiling 'src/lang/hix_lang_en.prg'...
Lines 2, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_lang_en.c'... Done.
Compiling 'src/lang/hix_lang_es.prg'...
Lines 124, Functions/Procedures 1
Generating C source output to '.hbmk/gcc/server/hix_lang_es.c'... Done.
hbmk2: Compilando...
hbmk2: Criando biblioteca estáticas... libhix_server.a

Best regards,
Itamar M. Lins Jr.

Itamar Lins

unread,
Aug 11, 2026, 4:01:46 PMAug 11
to Harbour Users
Hi!
On Linux OS.
Captura_de_tela_20260811_165326.png
File examples/server/src/app.prg
/*-----------------------------------------------------------
  File ......: app.prg
  Author.....: Carles Aubia Floresvi (Charly 9000)
  Created....: 2026-04-21
  Description: HIX Web Server main entry point
 -----------------------------------------------------------*/

REQUEST DBFCDX

FUNCTION Main()

   LOCAL oServer := THixServer():New()

   RddSetDefault( 'DBFCDX' )

   oServer:Start()

RETURN NIL

#ifndef __PLATFORM__WINDOWS
   /* Stubs to bypass Windows-specific API calls on Linux builds */
   FUNCTION WAPI_OUTPUTDEBUGSTRING( cMessage ); OutStd( cMessage + hb_eol() ); RETURN NIL
   FUNCTION WAPI_SHELLEXECUTE( a, b, c, d, e, f ); RETURN 42
#endif
File /examples/server/hix.hbp
# ============================================================
# hix_app.hbp — Example HIX Web Server
# ============================================================

-n
-w1
-es2
-inc
-head=full
-mt
-isrc/include
-workdir=.hbmk/${hb_compiler}/app

-hbexe
-ohix

# Main Test
src/app.prg

# Resources file
{msvc64}hix.res
{mingw64}hix.rc

# Libs
# Use relative paths or environment variables without hardcoded backslashes
-L../../
-lhix_server

# Windows-isolated .hbx files (since they use absolute/static Windows paths)
{win}${hix}\hix_server.hbx
{win}c:\harbour\include\harbour.hbx

# OpenSSL
-lhbssl
{win}-lhbssls
{msvc64}-llibcrypto-4-x64
{msvc64}-llibssl-4-x64
{mingw64}-ldflag=-l:libcrypto-4-x64.dll
{mingw64}-ldflag=-l:libssl-4-x64.dll

# On Linux/Unix, link the native system cryptographic libraries alongside
{unix}-lcrypto
{unix}-lssl

# Curl
{win}-lhbcurl
{msvc64}-llibcurl-x64
{mingw64}-ldflag=-l:libcurl-x64.dll

# Left commented out to make Linux completely ignore this library
{unix}hbcurl.hbc

# PDF
{msvc64}hbhpdf.hbc
{mingw64}-lhbhpdf
{mingw64}-llibhpdf
{mingw64}-lpng

# On Linux, link the located Harbour library and the native system dependency (libhpdf)
{unix}-lhbhpdf
{unix}-lhpdf
{unix}-lpng

# WAPI_OutputDebugString() and Windows libraries
{win}-lhbwin
-lxhb
-lhbct

# MSVC-specific linker flags (Windows)
{msvc64}-ldflag=/NODEFAULTLIB:libucrt
{msvc64}-ldflag=/NODEFAULTLIB:msvcrt
{msvc64}-lucrt
*-------End  of file hix.hbp

Tests on Linux Ubuntu(Kubuntu) 26.10
GCC 15.03


Best regards,
Itamar M. Lins Jr.

Charly 9000

unread,
Aug 20, 2026, 4:46:12 AMAug 20
to Harbour Users
Thanks ITamar, I'll check it on an Ubuntu machine when I can. There's a test that validates the build in each compiler, which I think is the best way to verify that it works the same for everyone.

https://github.com/carles9000/hix/tree/main/tests/unit

Once I've checked it, I'll upload it to the repo.

C.

Charly 9000

unread,
Aug 20, 2026, 4:51:33 AMAug 20
to Harbour Users
Hi,

I've added a simple example that you can check from your smartphone so you can see how well Harbour works on the web.


C.

Charly 9000

unread,
Sep 10, 2026, 2:09:32 AMSep 10
to Harbour Users
Hi,

HIX is also ready for Linux. 


C.

Franz

unread,
Sep 11, 2026, 12:59:14 PMSep 11
to Harbour Users


I’ve started trying out UT. What are the differences between UT and HIX?

Charly 9000

unread,
Sep 13, 2026, 2:16:53 AMSep 13
to Harbour Users

Hi Franz.

Just to give you a bit of context, UT was born on Mindaugas's httpd2 server, which at the time was the only one we knew about in Harbour and the one we kept building on. But over time it hit its limit: we realized a lot of stuff couldn't be scaled, expanded, or added because of structural limitations in the original design.

I decided to build a completely new version of the web server with a much more modern and solid architecture, designed from scratch to support multiple protocols (like http, ws, sse, independent workers, metrics, …) and to fit better with today's web.

HIX is the natural evolution of UT, and it was a necessary step so we can keep growing and pushing Harbour forward.


Regards.

C.


El dia divendres, 11 de setembre del 2026 a les 18:59:14 UTC+2, Franz va escriure:

Charly 9000

unread,
Sep 19, 2026, 2:48:29 AMSep 19
to Harbour Users
Hi,

El dia diumenge, 13 de setembre del 2026 a les 8:16:53 UTC+2, Charly 9000 va escriure:

dfpro...@gmail.com

unread,
Sep 19, 2026, 1:40:47 PMSep 19
to Harbour Users
Tranks mr. Charly
Daniele




--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/ffbfce43-0a8a-4fe7-a995-0d644bf87f20n%40googlegroups.com.

plink86

unread,
Oct 6, 2026, 5:05:59 AM (3 days ago) Oct 6
to Harbour Users
Hi C,

I was interested on the CRUD module and built a webapp. I have interesting findings, see more on https://github.com/lediz/hix/blob/enhance/ENHANCE.md.

P
Reply all
Reply to author
Forward
0 new messages