I'm trying to get and set cookies using the TOR API. The problem is that the SocksPortHandler doesn't have CookieContainer nor InnerHandler. I tried using Knapcode.SocketToMe.Http.CookieHandler and set its InnerHandler to SocksPortHandler but with no success. here is the code -

using (CookieHandler cookieHandler = new CookieHandler()) { SocksPortHandler socksPortHandler = new SocksPortHandler("127.0.0.1", socksPort: 9050); cookieHandler.InnerHandler = socksPortHandler; using (HttpClient httpClient = new HttpClient(cookieHandler)) { .....setting httpClient properties..... HttpResponseMessage message = httpClient.GetAsync(uri).Result; response = message.Content.ReadAsStringAsync().Result; cookieHeader = cookieHandler.CookieContainer.GetCookieHeader(uri); } } how can I do it? Thanks

just found the answer https://github.com/nopara73/DotNetTor/issues/18 hope it will help others

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.