Skip to content
/ gateway Public

L7 reverse proxy with dynamic service discovery for multi-tenant containerized workloads. Go-based replacement for Node.js gateway.

Notifications You must be signed in to change notification settings

bushev/gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gateway

Gateway is the routing layer for CodeSnack IDE's containerized development environments. It dynamically routes HTTP/WebSocket traffic to user-specific containers based on hostname patterns.

This is the first component being migrated from Node.js to Go for improved performance, lower memory footprint, and better concurrency handling under high load.

Architecture

┌───────────────────────────────────────────────────────────────┐
│                        Ingress Traffic                        │
│              (u777-8000.codesnack-ide.com/api/...)            │
└──────────────────────────────┬────────────────────────────────┘
                               │
                               ▼
                    ┌───────────────────────┐
                    │   Gateway Server      │
                    │  (Ingress Controller) │
                    └──────────┬────────────┘
                               │
                               ▼
                    ┌──────────────────────┐
                    │   Request Pipeline   │
                    │    (orchestrator)    │
                    └──────────┬───────────┘
                               │
               ┌───────────────┼───────────────┐
               │               │               │
               ▼               ▼               ▼
        ┌──────────┐      ┌────────────┐    ┌────────────┐
        │  Route   │      │ Context    │    │ Telemetry  │
        │ Resolver │      │ Enrichment │    │ Tracker    │
        └────┬─────┘      └────┬───────┘    └──────┬─────┘
             │                 │                   │
             │                 │                   │
   Service Discovery      Header injection   Instrumentation
   `u<userId>-<port>`     Add metadata       Metrics collection
   Parse tenant ID        Tracing context    Active sessions
   Lookup backend IP           │                   │
             │                 │                   │
             └─────────┬───────┴───────────────────┘
                       │
                       ▼
              ┌─────────────────┐
              │  Reverse Proxy  │
              │ (L7 forwarding) │
              └────────┬────────┘
                       │
                       ▼
              ┌────────────────────┐
              │   Workload Backend │
              │   (IPC transport)  │
              └────────────────────┘

Development

Build: make build
Run: make run
Test: make test

About

L7 reverse proxy with dynamic service discovery for multi-tenant containerized workloads. Go-based replacement for Node.js gateway.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published