https://github.com/soontao/express-limit-host
simple middleware to protect server from host/x-forwarded-host injection.
https://github.com/soontao/express-limit-host
express proxy security
Last synced: 2 months ago
JSON representation
simple middleware to protect server from host/x-forwarded-host injection.
- Host: GitHub
- URL: https://github.com/soontao/express-limit-host
- Owner: Soontao
- License: mit
- Created: 2021-02-03T02:10:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T05:14:26.000Z (over 2 years ago)
- Last Synced: 2024-04-15T00:06:32.313Z (over 2 years ago)
- Topics: express, proxy, security
- Language: TypeScript
- Homepage:
- Size: 1.97 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# express limit host

[](https://codecov.io/gh/Soontao/express-limit-host)

[](https://www.npmjs.com/package/express-limit-host)
simple middleware to protect server from `host`/`x-forwarded-host` injection.
## Usage
> just install & use it as an express middleware
```ts
const createHostLimit = require("express-limit-host")
const express = require("express")
const app = express()
app.use(createHostLimit({
loopback: true,
allowList: [
'proxy-server-host.com',
'direct-service-host.com'
],
rejectStatusCode: 403
}))
// add your router/handler
```
## [CHANGELOG](./CHANGELOG.md)
## [LICENSE](./LICENSE)