nopara73 / DotNetTor

Library implementation of essential Tor features in .NET Core.
https://www.nuget.org/packages/DotNetTor
MIT License
77 stars 21 forks source link

How to set cookie in POST or GET request? #18

Open drunkwolfs opened 6 years ago

drunkwolfs commented 6 years ago
  1. httpClient.DefaultRequestHeaders.Add("Cookie", CookieSID); not work, (the header does not contain cookies in the debugger)
  2. TorSocks5Handler do not support Properties CookieContainer Please add the ability to work with cookies using properties in TorSocks5Handler:
    • CookieContainer
    • UseCookies
nopara73 commented 6 years ago

Cookie is an optional HTTP header, which is described in RFC2965. I am all for adding this functionality, since in DotNetTor the HTTP protocol is implemented manually by me, header cookies must be implemented manually, too.

Alternatively you can take a look at @joelverhagen's TorSharp. He, instead of implementing HTTP from scratch opted into using an external program, called Privoxy, therefore it is more configurable. Note that, TorSharp does not work with .NET Core, but with .NET Framework.