# http-domain-based-forwarding

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

Latest version **1.0.12** (published 2021-05-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install http-domain-based-forwarding
pnpm add http-domain-based-forwarding
yarn add http-domain-based-forwarding
bun add http-domain-based-forwarding
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2021-05-22 |
| First published | 2018-05-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 (+3 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Haim Kastner |
| Maintainers | haimkastner |
| Keywords | http, https, sse, domain-proxy, proxy, forwarding |

## Links

- npm: https://www.npmjs.com/package/http-domain-based-forwarding
- Repository: https://github.com/haimkastner/http-domain-based-forwarding
- Homepage: https://github.com/haimkastner/http-domain-based-forwarding#readme
- Issues: https://github.com/haimkastner/http-domain-based-forwarding/issues
- npm.io page: https://npm.io/package/http-domain-based-forwarding

## Dependencies (6)

- [ws](https://npm.io/package/ws.md) ^5.2.0
- [log4js](https://npm.io/package/log4js.md) ^3.0.1
- [request](https://npm.io/package/request.md) ^2.88.2
- [eventsource](https://npm.io/package/eventsource.md) ^1.0.7
- [sse-channel](https://npm.io/package/sse-channel.md) ^3.1.1
- [reconnecting-ws](https://npm.io/package/reconnecting-ws.md) ^2.0.4

## Recent versions

- 1.0.12 (latest) — 2021-05-22
- 1.0.11 — 2020-09-26
- 1.0.10 — 2019-02-08
- 1.0.9 — 2018-07-20
- 1.0.8 — 2018-07-20
- 1.0.7 — 2018-07-20
- 1.0.6 — 2018-07-20
- 1.0.5 — 2018-07-20
- 1.0.4 — 2018-07-20
- 1.0.3 — 2018-07-20
- 1.0.2 — 2018-05-31
- 1.0.1 — 2018-05-31
- 1.0.0 — 2018-05-31

## 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 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);
});
```

---
_Source: https://npm.io/package/http-domain-based-forwarding · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
