0
I'm making an HTTP proxy in C++; when a client sends a GET
or CONNECT
request to the proxy, the proxy parses the HTTP header of the packet, resolve the hostname in it, opens another socket to the server destination and send client's request. Then the proxy will send server's response to the client.
Here's, for example, what the proxy sends to the server when he gets a GET
request or a CONNECT
request from the client:
GET http://www.gstatic.com/generate_204 HTTP/1.1
CONNECT cr-input.getspeakit.com:443 HTTP/1.1
But when I parse a GET
response from server, I find a 400 status code, i.e. Bad Request
: this seems to be (from Wikipedia):
a malformed request syntax, invalid request message framing, or deceptive request routing.
Do I send wrong arguments to the server in the GET
request?
It helps a lot, thank you very much I couldn't find any of these infos, not even in RFCs. Do you know of some link resuming what the proxy should send to the server, and what the proxy send back to the client? For example, the
CONNECT
method. – elmazzun – 2016-03-20T00:09:58.360I've updated my post to include links to the relevant RFCs, including for the
CONNECT
method. – Castaglia – 2016-03-20T01:22:21.763