Skip to content
VSI TECHNOLOGY · C11 · LINUX

One infrastructure. Multiple network services.

Versatile Service Infrastructure (VSI) is a modular network infrastructure platform written in C11 for Linux. One shared Layer 4 TCP core accepts incoming connections, validates configuration, supervises isolated service processes, and dispatches traffic to pluggable service handlers.

L4 TCP CoreShared DispatchProxy ServicesForward · ReverseAtomic TelemetryShared MemoryVSIVERSATILE SERVICE INFRASTRUCTURE

Forward HTTP & HTTPS Traffic

Route outbound HTTP/1.x requests and CONNECT TLS tunnels through a single Linux proxy listener.

Expose Multiple Backends

Map up to 16 local ports to internal HTTP services with automatic Host and Location header rewriting.

Operate Services Together

Run Forward Proxy and Reverse Proxy concurrently from one config.json with isolated supervised processes.

Inspect Live Latency & Traffic

Track active connections, byte throughput, and microsecond proxy overhead in real time.

Shared Foundation

A common connection engine instead of separate daemons

Instead of duplicating socket creation, signal handling, configuration validation, and telemetry across every tool, VSI separates Layer 4 connection transport from service protocol logic.

Layer 4 TCP Transport

vsi_transport_start() binds configured IPv4 endpoints with SO_REUSEADDR, ignores SIGPIPE, and dispatches accepted descriptors via vsi_connection_cb.

Multi-Service Supervisor

Single-service runs execute directly without fork overhead. When multiple services are enabled, main.c forks isolated child processes and handles SIGINT/SIGTERM shutdown cleanly.

Unified JSON Config & Validation

A single config.json configures backlog, metrics, forward proxy, and up to 16 reverse proxy mappings with pre-startup IPv4 and port-conflict validation.

Service Catalogue

Implemented services and platform roadmap

Explore all services

Forward Proxy

Available

Intermediary HTTP/1.x forward proxy and HTTPS CONNECT tunnel built on the shared L4 TCP listener.

  • Reads and parses incoming HTTP/1.x headers up to 16 KB (HTTP1_HEADER_BUFFER_SIZE) using http1_read_and_parse_headers().
  • For standard HTTP requests, extracts target host and port (defaulting to 80) from absolute-form URIs or the Host header, converts the URI to origin-form, filters Proxy-Connection and Expect headers, and forces Connection: close.
  • Streams request bodies of arbitrary size using either Content-Length or Transfer-Encoding: chunked framing, including HTTP/1.1 100 Continue handling when Expect: 100-continue is present.
config.json (Forward Proxy)
{
"engine": { "backlog": 128 },
"services": {
"forwardProxy": {
"enabled": true,
"listen_ip": "0.0.0.0",
"listen_port": 8085
}
}
}
config.json (Reverse Proxy)
{
"engine": { "backlog": 128 },
"services": {
"reverseProxy": {
"enabled": true,
"mappings": [
{
"listen_ip": "127.0.0.1",
"listen_port": 8081,
"target": "http://127.0.0.1:3000"
},
{
"listen_ip": "0.0.0.0",
"listen_port": 8083,
"target": "http://localhost:8080"
}
]
}
}
}

Reverse Proxy

Available

Multi-port HTTP/1.x reverse proxy with in-place request transformation and upstream Host/Location header rewriting.

  • Supports up to 16 port-to-backend mappings (VSI_MAX_RP_MAPPINGS); spawns dedicated listener threads when multiple mappings are active.
  • Uses reverse_proxy_transform_request_v2() to rewrite the Host header in-place to the backend host[:port] without allocating a duplicate HttpRequest struct, saving the original incoming Host value.
  • Forces Connection: close upstream (stripping Proxy-Connection and Expect) and streams request bodies via http1_stream_request_body().

Shared Metrics Endpoint

Available

Lock-free, cross-process atomic telemetry exposed over a lightweight local HTTP GET /metrics JSON endpoint.

  • Allocates cache-line-aligned (_Alignas(64)) C11 atomic counters in shared anonymous memory via mmap(MAP_SHARED | MAP_ANONYMOUS) before fork().
  • Records inbound/outbound bytes, total requests, active connections, failed requests, and CLOCK_MONOTONIC_RAW nanosecond timings (proxy overhead, upstream wait, and total latency).
  • Runs an HTTP server on a detached thread (default 0.0.0.0:9100) serving GET /metrics with serialized cJSON output.
GET /metrics Response
{
"requests": {
"total": 42,
"active": 1,
"failed": 0
},
"traffic_bytes": {
"inbound": 18432,
"outbound": 1048576
},
"latency_us": {
"avg_total": 1420.5,
"avg_upstream_wait": 1310.2,
"avg_proxy_overhead": 110.3,
"max_proxy_overhead": 384.0
}
}

In Development & Planned Capabilities

Explicitly separated from available features — not yet usable in production runs.

View full roadmap ->
In Development
Managed Worker Pool

Bounded circular-queue worker manager intended to replace detached per-connection pthread creation.

Planned
Persistent Connections & Pooling

HTTP/1.1 keep-alive support and reusable upstream connection pooling for the reverse proxy.

Planned
Secure Tunnel Service

Planned client/server encrypted tunneling service built on VSI’s modular service dispatch architecture.

Planned
Load Balancing

Planned multi-upstream request distribution and backend health checking for the reverse proxy.

System Architecture

From TCP accept() to service dispatch

Every service shares the same Layer 4 listener, HTTP/1.x streaming codec, outbound connector, and shared-memory telemetry store.

Deep dive into Architecture
TCP ClientHTTP/1.x · CONNECTVSI CORE ENGINE (vsi_ngine)Config & Fork Supervisormain.c · vsi_config.cL4 TCP Transport Loopvsi_transport_start()accept() -> vsi_connection_cbForward Proxyforward_proxy_on_connectionHTTP/1.x + CONNECT select()Reverse Proxyreverse_proxy_on_connectionV2 Host rewrite · up to 16 portsOrigin Servergetaddrinfo() TCPBackend Targethttp://host:portShared mmap() Atomic Metrics (vsi_metrics.c) -> GET :9100/metrics JSON
Linux Quickstart

Build and run vsi_ngine in under a minute

VSI compiles cleanly with standard Linux CMake (>= 3.28.3) and GCC or Clang with zero external package dependencies.

Linux Source Build
git clone https://github.com/VIKO-LABS/VNM.git
cd VNM
cmake -S . -B build
cmake --build build
./build/vsi_ngine -c config.json