vane 0.9.2

A flow-based reverse proxy with multi-layer routing and programmable pipelines.
---
title: Fetch Upstream
description: HTTP reverse proxying driver.
icon: Funnel
---

- **ID**: `internal.driver.upstream`
- **Source**: `src/plugins/l7/upstream/mod.rs`
- **Trait**: `HttpMiddleware`
- **Layer**: **L7 Only**

## Logic Flow

This plugin acts as the **First Phase** of Vane's L7 Two-Phase Dispatch. It fetches the response from the backend and populates the `Container`.

<Mermaid
	chart="
graph LR
    Req[Client Req] --> Pool{Get Conn}
    Pool --> Send[Send Req]
    Send --> Stream[Buffer/Stream Body]
    Stream --> State[Update Container]
    State --> Next[Next: Terminator]
"
/>

It **does not** send the response to the client. The flow must eventually reach a Terminator (like `SendResponse`) to flush the data.

### Output Branches

- **`success`**: Response headers/body received from upstream.
- **`failure`**: Connection failed, timeout, or protocol error.

### Parameters

| Name          | Required | Description                                             |
| :------------ | :------- | :------------------------------------------------------ |
| `url_prefix`  | **Yes**  | Base URL of the upstream (e.g., `http://backend:8080`). |
| `path`        | No       | Override request path (defaults to `req.path`).         |
| `query`       | No       | Override query string.                                  |
| `method`      | No       | Override HTTP method.                                   |
| `version`     | No       | Force HTTP version (`h1`, `h2`, `h3`, `auto`).          |
| `websocket`   | No       | Allow WebSocket upgrades (default `false`).             |
| `skip_verify` | No       | Skip upstream TLS certificate validation.               |