Z
Z
zax20022018-02-02 16:36:14
proxy
zax2002, 2018-02-02 16:36:14

Is it possible to access the proxy "manually"? && How?

Is it possible somehow from PHP to access the proxy, and not to the site through it? So that the request should be sent to the proxy address and pass the site address in some parameters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Dubrovin, 2018-02-02
@z3apa3a

If we are talking about an HTTP proxy, then there are two options:
1. As an HTTP proxy, while a regular HTTP request is made to the proxy with the only difference: not a relative path is passed as an argument, like GET / HTTP/1.0, but a full URI with indication of the protocol

GET http://example.com/ HTTP/1.1
Host: example.com

2. As a CONNECT proxy, a request is made
CONNECT example.com:80 HTTP/1.1
Host: example.com:80

after which the server response is read, if the response is successful, then further data transmitted through the connection will be proxied to the server port specified in CONNECT.
The second method is usually used for HTTPS, some proxies do not allow CONNECT on ports other than 443.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question