305 Use Proxy
The HTTP 305 Use Proxy status code is a deprecated response indicating the requested resource is accessible only through a proxy specified in the Location header.
Usage
The 305 Use Proxy status code instructs the client to obtain the requested resource through a proxy. The proxy address is specified in the Location header.
What replaced 305
Nothing in HTTP took over the role. Proxy selection moved out of the response and into client configuration: operating-system proxy settings, proxy auto-configuration (PAC) scripts, and the WPAD discovery mechanism that locates such a script on the local network. All of those are controlled by the user or the network administrator rather than by the origin server, which removes the in-band configuration risk that led to the deprecation. The Fetch Standard's redirect statuses are 301, 302, 303, 307 and 308, so a browser receiving a 305 treats it as an ordinary response and renders whatever body the server sent.
Example
The client requests a specific resource, and the server responds with 305 Use Proxy to indicate where the client sends an identical request.
Request
GET /document.pdf HTTP/1.1
Host: www.example.re
Response
HTTP/1.1 305 Use Proxy
Location: https://proxy.example.re:8080
Code references
.NET
HttpStatusCode.UseProxy
Rust
http::StatusCode::USE_PROXY
Rails
:use_proxy
Go
http.StatusUseProxy
Symfony
Response::HTTP_USE_PROXY
Python3.5+
http.HTTPStatus.USE_PROXY
Java
java.net.HttpURLConnection.HTTP_USE_PROXY
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_USE_PROXY
Angular
@angular/common/http/HttpStatusCode.UseProxy
See also
- RFC 9110: HTTP Semantics
- Expired draft refining 305 and 306 (1997)
- Fetch Standard: redirect status
- 306
- 300
- HTTP status codes