Harbour + Node.js via WebSocket: Modern Integration in ~300 Lines of Code – No Frameworks

Post Reply
User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Harbour + Node.js via WebSocket: Modern Integration in ~300 Lines of Code – No Frameworks

Post by Otto »

https://clipper2web.com/docs/nodejs.mp4

Hello friends,

Today I implemented something that for a long time was considered complex, untypical, or even unrealistic for Harbour —
and it turned out to be surprisingly simple.

What mattered most to me was long-term maintainability, debuggability, and a clear understanding of the interface.
I wanted a solution where the data flow is explicit and transparent, not hidden behind frameworks or abstractions.

Harbour now talks directly to Node.js via WebSocket.
No DLLs.
No frameworks.
No magic.

Just a few hundred lines of clean, explicit code — and suddenly a new door opens.

--- What this enables

A classic Harbour application can now:

  • establish a persistent WebSocket connection
  • communicate with a modern Node.js service
  • access SQL databases through Node.js
  • receive results directly back into Harbour

All of this is bidirectional, stateful, and fast.

Harbour does not become a web framework —
but it gains modern interface capability, and that is what really matters.

--- Key integration areas

Modern databases (without DLLs / ODBC)
PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Redis
→ Node.js handles pooling, reconnects, and TLS
→ Harbour stays focused on business logic

Cloud & Web APIs
Payments, logistics, CRM/ERP, geo services, messaging
→ Harbour only speaks JSON over WebSocket

AI & LLM services
Text analysis, document processing, assistants, translations
→ Harbour provides context, Node.js connects to AI providers

Real-time features
Live status, push updates, dashboards, multi-user scenarios
→ No polling — Harbour can react instantly

--- Clean separation of responsibilities
  • Harbour: business logic, validation, state
  • Node.js: APIs, protocols, external services
  • Outside world: SQL, cloud, AI

Result:

  • less complexity per layer
  • better maintainability
  • easier debugging
--- Why this matters
  • Existing Harbour systems remain intact
  • Decades of business logic are preserved
  • No rewrite, no “big bang” migration
  • Modernization becomes incremental and controlled

Harbour is not replaced — it becomes connectable.

Best regards,
Otto

https://clipper2web.com/docs/nodejs.mp4

Image

Post Reply