Skip to content

msk1039/simple-reverse-proxy-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Node.js Reverse Proxy

A basic reverse proxy server built with Node.js that forwards HTTP GET requests to predefined upstream servers.

Core Features

  • Basic HTTP request forwarding
  • YAML-based configuration
  • Multi-worker process support
  • Path-based routing with pattern matching
  • Static upstream server definitions
  • Technical Implementation
  • Uses Node.js cluster for worker processes
  • Configuration managed through YAML
  • Path matching with regex patterns
  • Single request type (GET) support
  • Random worker selection for request handling

Quick Start

# Install dependencies
npm install

# Start server with config
npm start -- --config config.yaml

Configuration Example

server:
  listen: 8000
  workers: 4
  
  upstreams:
    - id: upstream1
      url: jsonplaceholder.typicode.com

  rules:
    - path: /**
      upstreams:
        - upstream1

Limitations

  • Only supports GET requests
  • No load balancing algorithms
  • No health checks
  • No request/response transformation
  • No SSL/TLS support
  • No request queueing
  • No retry mechanisms

About

A nginx like reverse proxy server which can handle simple http requests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors