1.0.12 • Published 3 years ago

http-domain-based-forwarding v1.0.12

Weekly downloads
4
License
ISC
Repository
github
Last release
3 years ago

http-domain-based-forwarding

forward https/http requests based on domain\ip of request

support SSE implementation

Installing

npm install --save http-domain-based-forwarding

Sample use

var http = require('http');
var express = require('express');
var app = new express(); // Init the express app

var http_domain_based_forwarding = require('http-domain-based-forwarding');

// Init the forwarding/proxy routing
// (the received host ip\domain is the key and value is URL of target)
// And to get logs in console and file in ./logs folder set second parameter to true, (the default is false) 
var domain_proxy = new http_domain_based_forwarding({
  '127.0.0.1': 'http://127.0.0.1:80',
  'localhost': 'https://127.0.0.1:443'
}, true);

app.use(domain_proxy.express_middleware);

http.createServer(app).listen(80, () => {
  console.info('http proxy run on port ' + 80);
});
1.0.12

3 years ago

1.0.11

4 years ago

1.0.10

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago