Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haimkastner/http-domain-based-forwarding
forward https/http requests based on domain\ip of request
https://github.com/haimkastner/http-domain-based-forwarding
Last synced: about 16 hours ago
JSON representation
forward https/http requests based on domain\ip of request
- Host: GitHub
- URL: https://github.com/haimkastner/http-domain-based-forwarding
- Owner: haimkastner
- Created: 2018-05-09T16:44:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T19:06:04.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T00:26:17.295Z (about 1 month ago)
- Language: JavaScript
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```js
var http = require('http');
var express = require('express');
var app = new express(); // Init the express appvar 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);
});
```