# _scope

URL: /pounce/api/asgi/_scope/
Section: asgi
Description: Shared scope-building logic for HTTP and WebSocket ASGI bridges.

Extracts the common target parsing, path decoding, and header
conversion used by all three bridges (HTTP/1.1, HTTP/2, WebSocket).

---

> For a complete page index, fetch /pounce/llms.txt.

Open LLM text
(/pounce/api/asgi/_scope/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fasgi%2F_scope%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fasgi%2F_scope%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fasgi%2F_scope%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fasgi%2F_scope%2Findex.txt)

Module

#
`asgi._scope`

Shared scope-building logic for HTTP and WebSocket ASGI bridges.

Extracts the common target parsing, path decoding, and header
conversion used by all three bridges (HTTP/1.1, HTTP/2, WebSocket).

1Function

## Functions

`build_base_scope`

8

`dict[str, Any]`

▼

Build the common ASGI scope fields shared across all protocols.

`def build_base_scope(request: RequestReceived, *, scope_type: str, http_version: str, scheme: str, server: tuple[str, int], client: tuple[str, int], root_path: str, extensions: dict[str, Any] | None = None) -> dict[str, Any]`

##### Parameters

Name
Type
Description

`request`
`RequestReceived (/pounce/api/protocols/_base/#RequestReceived)`

Parsed HTTP request head.

`scope_type`
`str`

ASGI scope type (`"http"` or `"websocket"`).

`http_version`
`str`

Protocol version string (`"1.1"`, `"2"`).

`scheme`
`str`

URL scheme (`"http"`, `"https"`, `"ws"`, `"wss"`).

`server`
`tuple[str, int]`

Local`(host, port)`tuple.

`client`
`tuple[str, int]`

Remote`(host, port)`tuple.

`root_path`
`str`

ASGI root_path for reverse proxy setups.

`extensions`
`dict[str, Any] | None`

Optional ASGI extensions dict.

Default:`None`

##### Returns

`dict[str, Any]`
