Apr 23, 2015 09:24 AM
(This post was last modified: Oct 25, 2016 07:39 AM by Ninja.)
So I was messing around with Tor so I can use it as a proxy. This class library runs a headless version of Tor, so not the browser nor Vidalia, so only the Tor connection program so to speak. It does not work with multithreading, though, but you can modify it yourself to allow that. This is SOCKS only. The SOCKS port is 9150. If you want HTTP then use Privoxy to access it as an HTTP proxy. Also for people wondering what the use is; First of all you can browse anonymous on the web. The SOCKS proxies have high speeds and anonymity similar to private, paid proxies. Second, I use this along with Privoxy with all my bots. The proxies work amazingly well and fast with Netflix, Spotify, Twitter, Amazon, and many more services. No more fiddling with proxies that don't work. Download Privoxy, follow the tutorial to make it work with Tor, and then use the proxy as "localhost:8118", and call the identity change function each time you want a different IP.
The functions of the class library are:
- Launching headless Tor with a slightly modified config file and the appropriate arguments.
- Exiting Tor, obviously.
- Changing identity (IP address) by requesting a new exit node. This process only takes a few hundred milliseconds, so you won't notice it when you are browsing the net while it changes IP.
Source is pretty straight forward. The only thing that might need a bit of explanation is the identity changing function. What it does is connect to the Tor control port (9151) and authenticate with the default password ("" - the password is the double quotes itself, not 'empty' or null.) then send a command to request a new exit node, and then return a string saying that it successfully connected (or not).
The streams are not disposed of, which doesn't really matter since it is an underlying stream in a class library. It will not likely create much garbage. Also, always remember to close Tor with the function after you use it, or with task manager, as it is headless you wont notice it, until after a while you have 20 Tor processes running.
Here is the source, the class library, and the headless Tor:
http://www.mediafire.com/download/3bm268...rProxy.zip
If you download it, please show some love by posting in the thread. It keeps me motivated to release more stuff.
How to use:
Put the Tor folder in the same folder as the application you are running. If you are still working in Visual Studio put the folder in the Debug and Release folder and when you share your program include the Tor folder as well. If you are using the DLL follow the same instructions as with the Tor folder. The DLL is not needed if you add the source file to your project. You don't have to manually launch the tor.exe by itself, and it wouldn't even work, as the library does it programmatically and also passes the right arguments.
The functions of the class library are:
- Launching headless Tor with a slightly modified config file and the appropriate arguments.
- Exiting Tor, obviously.
- Changing identity (IP address) by requesting a new exit node. This process only takes a few hundred milliseconds, so you won't notice it when you are browsing the net while it changes IP.
Source is pretty straight forward. The only thing that might need a bit of explanation is the identity changing function. What it does is connect to the Tor control port (9151) and authenticate with the default password ("" - the password is the double quotes itself, not 'empty' or null.) then send a command to request a new exit node, and then return a string saying that it successfully connected (or not).
The streams are not disposed of, which doesn't really matter since it is an underlying stream in a class library. It will not likely create much garbage. Also, always remember to close Tor with the function after you use it, or with task manager, as it is headless you wont notice it, until after a while you have 20 Tor processes running.
Here is the source, the class library, and the headless Tor:
http://www.mediafire.com/download/3bm268...rProxy.zip
If you download it, please show some love by posting in the thread. It keeps me motivated to release more stuff.
How to use:
Put the Tor folder in the same folder as the application you are running. If you are still working in Visual Studio put the folder in the Debug and Release folder and when you share your program include the Tor folder as well. If you are using the DLL follow the same instructions as with the Tor folder. The DLL is not needed if you add the source file to your project. You don't have to manually launch the tor.exe by itself, and it wouldn't even work, as the library does it programmatically and also passes the right arguments.



