DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can make an http(s) reverse proxy in nodejs?

A simple how to is located in my stackoverflow question:

I am developing an http "middleman" (aka reverse proxy) using nodejs. So far I made a basic server listening to http and https:

const http = require('node:http')
let https = require('node:https');


const app = (req,res)=>{
  // Forward the request to respecitve http
};

http.createServer(app).listen(80);
https.createServer({
  // typical https options ommited

Top comments (1)

Collapse
 
snowowl profile image
Snow Owl

Rather than reinventing the wheel, one alternative option is to use a reverse proxy as a service, like ours. We're edge-based for high availability, provide detailed request-level observability, and have a robust routing rules engine, all in a low/node code and serverless SaaS.

You can check us out at SnowOwl.co!