L
L
Lex0702019-03-15 07:27:19
C++ / C#
Lex070, 2019-03-15 07:27:19

Is it possible to add headers to the CONNECT method/request?

Hello! I have a client and a proxy server in C#. The client uses the CONNECT method to connect to the site through a proxy server. Tell me, is it possible to add some additional header to the CONNECT method?
To be more precise, I use HttpWebRequest to organize the client. Using the client, I send a Connect request to the proxy server. On the proxy, I see headers like in the picture (top of the proxy server console). Then a handshake, opening a tunnel and getting the html page to the client console (below). More specifically, my question can be put like this, can I add headers to the CONNECT request on the client or on the proxy server, not just User-agent, host and proxy-connection?5c8b37818d9fa971808563.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mshak, 2019-03-15
@mshak

As far as I remember, it should be something like this...
webRequest.Headers.Add(header_name, header_value);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question