The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 22, 2019, 05:25:04 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Proxies for *nix  (Read 3116 times)
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« on: August 26, 2008, 06:10:39 AM »

OK Im having a brain fart moment.

I normally run spammy announcement scripts from my local wamp install, however I am finding myself now
in the need for more automation.. (re.. scripts run from cron) and also not on my local wamp,
but on a dev box that I have here running FreeBSD.

Being a noobie System admin, ive not had to worry about proxy support for requests sent
like this before, as my scripts use proxy support through Privoxy/Tor/Curl.

How is it done? How can I make sure that all requests through this box (Posting) are proxified?
Logged
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #1 on: August 26, 2008, 06:13:17 AM »

Need more information...

You can do application-level proxying, e.g. specify a proxy to use in your script...

Or you can do service level proxying, use iptables to forward all traffic outbound on a particular port through a proxy

Or you can do global proxying, and forward all requests for anything through a proxy...but I wouldn't recommend that.
Logged

hai
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #2 on: August 26, 2008, 06:56:26 AM »

I probably shouldnt have said *all* requests.

Im not sure what would be the best way of doing it.

Id be doing it at application level I suppose.
As Id write a script to check my proxy list, then pull proxies from a database to use within curl.

Is this all I'd need? Is it this easy?

Probably a dumb question, but Im not really up to speed on network stuff as yet.
Ive always taken the easy way out and used programs already built, but have now
decided to start rolling my own way of doing things.

For what its worth this is how I have been running some scripts thus far from WAMP,
using P/T/Vidalia.

Code:
$tor = 'localhost:8118';
curl_setopt ($ch, CURLOPT_PROXY, $tor);
if (isset($proxy)) {
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5 );
}
Logged
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #3 on: August 26, 2008, 07:13:54 AM »

Yeah that's fine.

If you're using BSD, I assume you have portage? You'll want to install the tor bundle, configure it (there are a plethora of how-to's on the web for various flavors of *nix + tor), and then just set it as your proxy in cURL.
Logged

hai
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #4 on: August 26, 2008, 07:18:43 AM »

Yep, i use the ports.

Thanks vs.
Logged
emonk
Rookie
**
Offline Offline

Posts: 44


View Profile
« Reply #5 on: August 26, 2008, 09:55:11 AM »

 Another nice way to do this is with ProxyChains. It'll will 'proxify' any application, without the need for any re-coding. If you combine that with Tor, you could do it all without having to alter any code.

Logged
deregular
Expert
****
Offline Offline

Posts: 172


View Profile
« Reply #6 on: August 26, 2008, 06:01:07 PM »

Interesting. Thanks emonk, will take a look.
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!