Skip to content

v1.1.0: Enterprise Gateway Features, WebSockets & Open-Source Packaging

Choose a tag to compare

@varuns2903 varuns2903 released this 09 Aug 17:46
· 190 commits to main since this release

This massive feature release officially transitions the Orbit HTTP Server from an asynchronous web server into a fully-fledged, production-ready backend framework and enterprise reverse proxy.

### 🚀 Major Features                                                                                                                                                                            
                                                                                                                                                                                                 
**1. Enterprise Reverse Proxy & TLS Tunneling**                                                                                                                                                  
* **Upstream TLS/HTTPS Tunneling**: The `middleware::ProxyRequest` system now features a fully asynchronous OpenSSL `BIO`/`SSL` state machine, allowing the framework to securely proxy traffic  

to https:// upstream targets.
* Gateway Header Injection: The proxy automatically injects standard tracking headers (X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host) into proxied requests.
* Raw Stream Upgrades (WebSocket Proxying): Implemented upgrade_to_raw_stream() into the ResponseWriter and Connection core. The proxy now intelligently intercepts 101 Switching Protocols handshakes and converts the connection into a zero-allocation, bi-directional raw byte stream to flawlessly proxy WebSockets.

**2. Core Developer Ergonomics**
* **Native JSON APIs**: Integrated `nlohmann/json` directly into `HttpRequest` and `HttpResponse`. Access JSON payloads instantly via `req.json()` or send JSON responses effortlessly using     

res.json({{"key", "value"}}).
* Zero-Copy Multipart Form Parsing: Built a hyper-efficient MultipartForm parser for handling multipart/form-data payloads (file uploads) without allocating unnecessary memory buffers.

**3. Open-Source Distribution & Examples**
* **CMake `find_package` Integration**: Added comprehensive CMake installation targets (`HttpServerConfig.cmake`). You can now seamlessly integrate the framework into your own apps using       

find_package(HttpServer REQUIRED).
* Doxygen API Documentation: Integrated Doxygen support. Simply run make docs to generate a beautiful, navigable HTML documentation site for the C++ framework API.
* Showcase Examples: Shipped two highly robust example applications inside the /examples directory:
* rest_api.cpp: A mock database showcasing our new JSON routing features.
* chat_server.cpp: A real-time, thread-safe, multi-client chat room demonstrating our app.ws() WebSocket routing capabilities.

### ⚙️ Quick Start Example
Explore the new WebSocket routing capabilities:
```cpp
#include "server/App.hpp"
#include <iostream>

int main() {
    config::ServerConfig cfg;
    cfg.port = 8081;
    server::App app(cfg);

    app.ws("/chat", [](http::websocket::WebSocketConnection& ws) {
        ws.send("Welcome to Orbit WebSockets!");
        ws.on_message([&ws](const std::string& msg) {
            ws.send("Echo: " + msg);
        });
    });

    std::cout << "Starting Server on ws://localhost:8081/chat\n";
    app.listen();
}