Answer the question
In order to leave comments, you need to log in
How to create an HTTPS tunnel in C# to send a GET request to the server via HttpWebRequest separately from it?
You need to make several consecutive requests in c #
HttpWebRequest Request0
HttpWebResponse response0
HttpWebRequest Request1
HttpWebResponse response1
HttpWebRequest Request2
HttpWebResponse response2
.....
Through HttpWebRequest tunnels are created in between requests, It takes a lot of time to do this.
Can I somehow create these tunnels right away? Through the same Threading.Tasks.Parallel.For, for example, 10 pieces at once, and then sequentially send 10 HTTPS requests through these tunnels?
Answer the question
In order to leave comments, you need to log in
In C#, the System.Net.ServicePointManager manages connections and decides when to create a new tunnel. If requests are made sequentially to the same host port, using the same protocol, and through the same proxy, then everything should go through one tunnel. Make sure you close the response object and release the connection before the next request.
If you need very quickly, you can manually open a tcp socket, wrap it in ssl and send the necessary requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question