Add atproto-proxy header support for service proxying #24

Closed
opened 2026-04-12 17:29:21 +00:00 by Grandiras · 0 comments
Owner

Summary

The AT Protocol supports the atproto-proxy HTTP header for proxying requests through a PDS to backend services (like App Views, labelers, chat services). ATProto.NET doesn't currently support this header.

Spec Reference

When making XRPC requests through a PDS, the atproto-proxy header tells the PDS which service to forward the request to. Format:

atproto-proxy: did:web:api.bsky.app#bsky_appview

The header value is a DID with a service endpoint fragment identifier. The PDS resolves the DID, finds the matching service endpoint, and proxies the request there.

What's needed

  1. Proxy header support on XrpcClient - Ability to set atproto-proxy header per-request or as default
  2. Service proxy builder - Helper to construct proxy header values from DID + service ID
  3. Common service constants - Well-known service identifiers:
    • #bsky_appview - Bluesky App View
    • #bsky_chat - Bluesky Chat service
    • #atproto_labeler - Labeler service
    • #atproto_pds - PDS service

Why this matters

  • Required for chat.bsky endpoints (routed through PDS to chat service)
  • Required for labeler service queries
  • Required for some moderation endpoints
  • Enables proper service-to-service communication in the AT Protocol architecture
  • #17 (chat.bsky support needs proxy headers to route to chat service)
## Summary The AT Protocol supports the `atproto-proxy` HTTP header for proxying requests through a PDS to backend services (like App Views, labelers, chat services). ATProto.NET doesn't currently support this header. ## Spec Reference When making XRPC requests through a PDS, the `atproto-proxy` header tells the PDS which service to forward the request to. Format: ``` atproto-proxy: did:web:api.bsky.app#bsky_appview ``` The header value is a DID with a service endpoint fragment identifier. The PDS resolves the DID, finds the matching service endpoint, and proxies the request there. ## What's needed 1. **Proxy header support on XrpcClient** - Ability to set `atproto-proxy` header per-request or as default 2. **Service proxy builder** - Helper to construct proxy header values from DID + service ID 3. **Common service constants** - Well-known service identifiers: - `#bsky_appview` - Bluesky App View - `#bsky_chat` - Bluesky Chat service - `#atproto_labeler` - Labeler service - `#atproto_pds` - PDS service ## Why this matters - Required for chat.bsky endpoints (routed through PDS to chat service) - Required for labeler service queries - Required for some moderation endpoints - Enables proper service-to-service communication in the AT Protocol architecture ## Related - #17 (chat.bsky support needs proxy headers to route to chat service)
Sign in to join this conversation.
No description provided.