The HTTP Status Code 305, known as “Use Proxy,” is a non-standard status code that informs the client that the requested resource must be accessed through a specified proxy server. This status code is part of the HTTP/1.1 specification and is defined in RFC 2616.
When a client sends a request to a server, the server may return a 305 status code to indicate that the requested resource is only accessible through a proxy. The server includes the required proxy’s URI in the response’s
Location header. The client must then resend the request to the specified proxy to access the resource.
It’s essential to note that the 305 status code is deprecated due to security concerns and has been removed from the HTTP/1.1 specification in RFC 7231. Most modern browsers do not support this status code, and it’s generally not recommended for use.
Here’s an example of an HTTP request and the corresponding 305 Use Proxy response:
GET /example/resource HTTP/1.1 Host: www.example.com
HTTP/1.1 305 Use Proxy Location: http://proxy.example.org:8080 Content-Type: text/html; charset=utf-8 Content-Length: 123
In this example, the server responds with a 305 status code, indicating that the client must use the specified proxy (http://proxy.example.org:8080) to access the requested resource. The client should resend the request to the proxy server.
- As mentioned earlier, the 305 status code is deprecated and removed from the HTTP/1.1 specification. It’s generally not recommended for use due to security concerns.
- Most modern browsers do not support the 305 status code. For instance, Google Chrome and Mozilla Firefox will ignore the 305 response and treat it as an error.
- If you need to implement proxy functionality, consider using alternative methods like configuring the client to use a proxy or using a reverse proxy server.
- The 305 status code should not be confused with the 306 status code (Switch Proxy), which is also deprecated and unused.
In summary, the HTTP Status Code 305 (Use Proxy) is a deprecated and non-standard status code that informs the client to access the requested resource through a specified proxy server. Due to security concerns and lack of support in modern browsers, it’s generally not recommended for use. Instead, consider alternative methods for implementing proxy functionality.