0

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

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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