306 Switch Proxy

HTTP response status code 306 Switch Proxy is a reserved and unused status code specified in the HTTP/1.1 specification with the intention to redirect a client to use an alternate proxy, and the new location to be valid for a specified period.

Usage

The 306 Switch Proxy status code is to be sent by a server in response to a client HTTP request for a resource through a proxy, but the proxy location has changed. The Set-Proxy HTTP header is included to specify the new location of the alternate proxy, as well as to indicate how long the address will be valid for.

Note

The 306 Switch Proxy status code is currently not used and reserved for future use.

Example

In the example, the client requests a resource through a proxy and is instead told by the server, via 306 Switch Proxy status code, that it is available at an alternate location for 120 seconds.

Request

GET /document.pdf HTTP/1.1
Host: proxy.example.re

Response

HTTP/1.1 306 Switch Proxy
Set-Proxy: SET; proxyURI=""https://proxy-2.example.re:8080/" scope="http://", seconds=120

Code references

.NET

HttpStatusCode.Unused

Symfony

Response::HTTP_RESERVED

Angular

@angular/common/http/HttpStatusCode.Unused

Takeaway

The 306 Switch Proxy status code is intended to instruct a client to use an alternative proxy to retrieve the requested resource.

See also

Last updated: August 2, 2023