conninfo.ts
This file
Path
src/adapter/lambda-edge/conninfo.ts
18 lines 路 486 bytes 路 TypeScript
Last changed by
feat(adapters): add the seven adapters as workspace packages (#5463)Yusuke Wadabefore adoptionb877827
History of this fileTake it
12345678910111213141516171819import type { Context } from '../../context'import type { GetConnInfo } from '../../helper/conninfo'import type { CloudFrontEdgeEvent } from './handler'
type Env = { Bindings: { event: CloudFrontEdgeEvent }}
/** * @deprecated `hono/lambda-edge` will be removed in v5. Install `@hono/lambda-edge` and import from there instead. */export const getConnInfo: GetConnInfo = (c: Context<Env>) => ({ remote: { address: c.env.event.Records[0].cf.request.clientIp, },})