# tinyhttp-forwarded **Repository Path**: ArkTSCentralRepository/tinyhttp-forwarded ## Basic Information - **Project Name**: tinyhttp-forwarded - **Description**: tinyhttp-forwarded 是一个用于处理代理请求并确定请求源地址的库,提供 forwarded 函数解析 x_forwarded_for 头部信息。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-11-21 - **Last Updated**: 2024-11-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # tinyhttp-forwarded 基于[@tinyhttp/forwarded](https://www.npmjs.com/package/@tinyhttp/forwarded)原库2.1.2版本进行适配, 所有功能代码已经转换为`ArkTS`文件 ## Install ```sh ohpm install tinyhttp-forwarded ``` ## Description > [`forwarded`](https://github.com/jshttp/forwarded) rewrite in ArkTS Determine address of a proxied request ## API * forwarded(req: Request): string[] ## Usage ```typescript import { forwarded, Request } from '@tinyhttp/forwarded' const req: Request = { headers: { x_forwarded_for: '' }, socket: { remoteAddress: '192.168.0.1' } }; const result = forwarded(req); ```