Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deno-libs/forwarded
Deno port of `forwarded` library
https://github.com/deno-libs/forwarded
backend deno deno-library deno-port http x-forwarded-for
Last synced: about 2 months ago
JSON representation
Deno port of `forwarded` library
- Host: GitHub
- URL: https://github.com/deno-libs/forwarded
- Owner: deno-libs
- License: mit
- Created: 2021-03-06T13:29:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T17:11:26.000Z (over 1 year ago)
- Last Synced: 2024-09-17T15:18:44.119Z (3 months ago)
- Topics: backend, deno, deno-library, deno-port, http, x-forwarded-for
- Language: TypeScript
- Homepage: https://deno.land/x/forwarded
- Size: 26.4 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - forwarded - Deno port of `forwarded` library. (Modules / Web utils)
README
# forwarded
[![GitHub release (latest by date)][releases]][releases-page] [![GitHub Workflow Status][gh-actions-img]][github-actions]
[![Codecov][codecov-badge]][codecov] [![][docs-badge]][docs]Deno port of [forwarded](https://github.com/jshttp/forwarded/) library.
## Usage
```ts
import { forwarded } from 'https://deno.land/x/forwarded/mod.ts'Deno.serve((req) => new Response(JSON.stringify(forwarded(req)))
```## API
### `forwarded(req)`
Get all addresses in the request, using the `X-Forwarded-For` header.
### `parse(header)`
Parse the X-Forwarded-For header.
[releases]: https://img.shields.io/github/v/release/deno-libs/forwarded?style=flat-square
[docs-badge]: https://img.shields.io/github/v/release/deno-libs/forwarded?color=yellow&label=Documentation&logo=deno&style=flat-square
[docs]: https://doc.deno.land/https/deno.land/x/forwarded/mod.ts
[releases-page]: https://github.com/deno-libs/forwarded/releases
[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/deno-libs/forwarded/main.yml?branch=master&style=flat-square
[codecov]: https://codecov.io/gh/deno-libs/forwarded
[github-actions]: https://github.com/deno-libs/forwarded/actions
[codecov-badge]: https://img.shields.io/codecov/c/gh/deno-libs/forwarded?style=flat-square