Skip to content

feat(http): add transport extension hooks - #3538

Open
patlux wants to merge 1 commit into
tauri-apps:v2from
patlux:3414-http-transport-extensions
Open

feat(http): add transport extension hooks#3538
patlux wants to merge 1 commit into
tauri-apps:v2from
patlux:3414-http-transport-extensions

Conversation

@patlux

@patlux patlux commented Aug 17, 2026

Copy link
Copy Markdown

Motivation

tauri-plugin-http currently creates an internal reqwest::ClientBuilder for every request without exposing a native customization point. Applications that need transport-level policies or custom TLS backends must therefore replace the fetch-compatible plugin surface with custom commands.

This change adds trusted native transport extensions while preserving the existing JavaScript API and default init() behavior.

Design

  • tauri_plugin_http::Builder<R> registers extensions in deterministic order.
  • HttpTransportExtension<R> exposes fallible setup, request validation, final reqwest::ClientBuilder configuration, and transport-error mapping.
  • RequestContext provides owned request metadata without exposing request bodies.
  • ExtensionError forwards extension-owned structured JSON through IPC while existing plugin errors remain strings.
  • Stock timeout, redirect, proxy, cookie, and feature-gated TLS settings are applied before transport extensions configure the final client.

This provides a general foundation for native transport concerns such as custom TLS verification, mTLS, request policy enforcement, and transport diagnostics. SPKI pinning from #3414 can be implemented as a separate extension on top of this API.

Follow-up implementation: #3539.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant