# getConnInfo

**Kind:** Function

**Source:** [`src/adapter/bun/conninfo.ts`](https://github.com/honojs/hono/blob/main/src/adapter/bun/conninfo.ts#L10)

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

Get ConnInfo with Bun

`getConnInfo` reads connection details for the current request when running on Bun. It is intended for handlers that need access to request connection metadata through the Bun adapter.

## Signature

```ts
function getConnInfo(c: Context)
```

## Parameters

| Name | Type |
|---|---|
| `c` | `Context` |

## Diagram

```mermaid
graph LR
  Request --> Context
  Context --> getConnInfo
  getConnInfo --> BunServer
  BunServer --> ConnInfo
  ConnInfo --> Handler
```

## Usage

```ts
import { Hono } from 'hono'
import { getConnInfo } from 'hono/bun'

const app = new Hono()

app.get('/connection', (c) => {
  const connInfo = getConnInfo(c)

  return c.json(connInfo)
})

export default app
```

## AI Coding Instructions

- Call `getConnInfo` from a request handler with the active Hono context.
- Use this Bun-specific helper only when the application is running with the Bun adapter.
- Keep connection metadata handling separate from request parsing and response creation.
- Handle missing or unavailable connection details before relying on them for application logic.

## Relationships

- IMPORTS → `getBunServer`
