🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Via

HTTP Header

The Via request and response header are added by proxies, both forward and reverse.

They are utilized for tracking message forwarding, preventing request loops, and identifying the protocol capabilities of the sender throughout the request and response chain.

Syntax

http
Via: [<protocol-name>/]<protocol-version> <host>[:<port>]
Via: [<protocol-name>/]<protocol-version> <pseudonym>

Processed and formatted content as requested.

Directives

Directives

<protocol-name>
The name of the protocol used, such as “HTTP”.
<protocol-version>
The version of the protocol used, such as “1.1”.
<host>
Public proxy URL and optional <port>.
If a host is not provided, then a <pseudonym> must be used.
<pseudonym>
Name or alias of an internal proxy.
If a pseudonym is not provided, then a <host> must be used.

Example

Via: 1.1 vegur
Via: HTTP/1.1 GWA
Via: 1.0 fred, 1.1 p.example.net

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Via header. This can help you test how intermediaries, like proxies or gateways, affect your requests or debug issues related to request routing. Steps to Modify the Via Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Via.
    • In the “Header Value” field, enter the desired value (e.g., 1.1 example-proxy).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the Via header into all matching requests, allowing you to simulate the presence of proxies or intermediaries and better understand how your application handles such scenarios.