# getConnInfo

**Kind:** Function

**Source:** [`src/adapter/cloudflare-pages/conninfo.ts`](https://github.com/honojs/hono/blob/main/src/adapter/cloudflare-pages/conninfo.ts#L22)

**Part of:** [Adapter](subsystem-src-adapter)

Get connection information from Cloudflare Pages

`getConnInfo` reads connection details from a Cloudflare Pages request. It maps Cloudflare-specific request metadata into the connection information shape used by the adapter layer.

## Signature

```ts
function getConnInfo(c)
```

## Parameters

| Name | Type |
|---|---|
| `c` | `any` |

## Diagram

```mermaid
graph LR
  A[Cloudflare Pages Request] --> B[getConnInfo]
  B --> C[Connection Information]
  C --> D[Adapter Request Handling]
```

## Usage

```ts
import { getConnInfo } from "./conninfo"

export const onRequest: PagesFunction = async ({ request }) => {
  const connInfo = getConnInfo(request)

  console.log(connInfo)

  return new Response("OK")
}
```

## AI Coding Instructions

- Pass the Cloudflare Pages `Request` object to `getConnInfo`.
- Keep Cloudflare-specific header and request metadata handling inside this adapter module.
- Return connection data in the shared shape expected by the rest of the adapter system.
- Account for connection fields that may be absent in local development or test environments.
