# IPRestrictionRule

**Kind:** Type

**Source:** [`src/middleware/ip-restriction/index.ts`](https://github.com/honojs/hono/blob/main/src/middleware/ip-restriction/index.ts#L38)

**Part of:** [Middleware](subsystem-src-middleware)

## Definition

```ts
string | ((addr: { addr: string; type: AddressType }) => boolean)
```

## Relationships

- IMPORTS → `HTTPException`
- IMPORTS → `convertIPv4MappedIPv6ToIPv4`
- IMPORTS → `convertIPv4ToBinary`
- IMPORTS → `convertIPv6BinaryToString`
- IMPORTS → `convertIPv6ToBinary`
- IMPORTS → `distinctRemoteAddr`
- IMPORTS → `isIPv4MappedIPv6`
- IMPORTS → `INVALID_IP_ADDRESS_ERROR_CODE`
