# ConnInfo

**Kind:** Interface

**Source:** [`src/helper/conninfo/types.ts`](https://github.com/honojs/hono/blob/main/src/helper/conninfo/types.ts#L35)

**Part of:** [Helper](subsystem-src-helper)

HTTP Connection information

`ConnInfo` describes HTTP connection metadata associated with an incoming request. It currently exposes the remote endpoint address through the `remote` field, represented by `NetAddrInfo`.

## Properties

| Property | Type |
|---|---|
| `remote` | `NetAddrInfo` |

## Diagram

```mermaid
graph LR
  Request[Incoming HTTP Request] --> ConnInfo[ConnInfo]
  ConnInfo --> Remote[remote: NetAddrInfo]
```

## Usage

```ts
import type { ConnInfo } from "./helper/conninfo/types.ts";

function logRemoteAddress(connInfo: ConnInfo) {
  console.log("Remote address:", connInfo.remote);
}

// `connInfo` is typically provided by the HTTP server runtime.
function handleRequest(request: Request, connInfo: ConnInfo) {
  logRemoteAddress(connInfo);

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

## AI Coding Instructions

- Treat `ConnInfo` as request-scoped metadata supplied by the HTTP server layer.
- Read the client endpoint from `connInfo.remote`; do not infer it from request headers.
- Keep `ConnInfo` fields typed with connection-related types such as `NetAddrInfo`.
- Pass `ConnInfo` through handlers when request logic needs remote connection details.
