Via
The "Via" header field indicates the presence of intermediate protocols and recipients between the user agent and the server (on requests) or between the origin server and the client (on responses).
The Forwarded header can also convey this information, plus information on the client, such as IP address.
Writing requests (clients)
User-agents do not send this header, as they are the originator of the message.
Intermediate nodes (caches, proxies, and gateways) must add themselves to the list.
Reading requests (servers)
This is an informational header and can be used for debugging purposes.
For a header with more information to act on, consider the Forwarded header.
Writing responses (servers)
Origin servers do not send this header, as they are the originator of the message.
Intermediate nodes may add themselves to the list, but are not required. Proxies and caches should add themselves for transparency purposes, gateways (intended to be transparent to the user) should not.
Reading responses (clients)
This is an informational header and can be used for debugging purposes.
Overview table
- Name
- Via
- Description
- Lists upstream nodes that have processed the message.
- Direction
- Both
- Specification
- RFC 7230: HTTP/1.1: Message Syntax and Routing ยง5.7.1. Via
Syntax
Via = 1#( received-protocol RWS received-by [ RWS comment ] )
received-protocol = [ protocol-name "/" ] protocol-version
; see Section 6.7
received-by = ( uri-host [ ":" port ] ) / pseudonym
pseudonym = token
Example
Via: 1.0 fred, 1.1 p.example.net