vane 0.9.0

A flow-based reverse proxy with multi-layer routing and programmable pipelines.
---
title: Proxy & Routing
description: Target resolution and load balancing strategies.
icon: ArrowLeftRight
---

import { Step, Steps } from 'fumadocs-ui/components/steps';

## Overview

The Proxy system is responsible for resolving logical targets into physical network addresses and selecting the best backend based on health and strategy.

## Routing Workflow

<Steps>
<Step>

### Target Resolution

Vane resolves the logical destination into a list of possible IP addresses.

<Mermaid
	chart="
graph LR
    Input[Target Input] --> Type{Type?}
    Type -- IP --> Static[IP Address]
    Type -- Domain --> DNS[Async DNS Lookup]
    Type -- Node --> Registry[Service Discovery]
    Static & DNS & Registry --> List[Target List]
"
/>

</Step>
<Step>

### Health Filtering

The resolved list is filtered against the `TARGET_HEALTH_REGISTRY` to remove unhealthy backends.

<Mermaid
	chart="
graph LR
    List[Target List] --> Health{Check Health}
    Health -->|Healthy| Pool[Available Pool]
    Health -->|Dead| Fallback[Fallback Pool]
"
/>

</Step>
<Step>

### Strategy Selection

Vane applies the configured load-balancing strategy to select a single target from the pool.

<Mermaid
	chart="
graph LR
    Pool[Available Pool] --> Strategy{Strategy?}
    Strategy -- Random --> Rand[Pick Random]
    Strategy -- Serial --> Round[Round Robin]
    Strategy -- Fastest --> Latency[Min Latency]
    Rand & Round & Latency --> Choice[Selected Target]
"
/>

</Step>
<Step>

### Forwarding (I/O)

Finally, the connection is handed over to the protocol-specific forwarder for bidirectional data copying.

<Mermaid
	chart="
graph LR
    Choice[Target] --> Connect[Connect]
    Connect --> Pipe[Bi-Di Copy]
"
/>

</Step>
</Steps>

## Strategy Details

| Strategy      | Description                                                           |
| :------------ | :-------------------------------------------------------------------- |
| **`Random`**  | Picks a target using a uniform distribution.                          |
| **`Serial`**  | Round-robin selection using atomic counters.                          |
| **`Fastest`** | Picks the target with the lowest latency (based on TCP Health Check). |