Freelancer上有个proxy setup的任务:

Project Description  
Hi, I would like to create a new VPS proxy server with multiple IPs on the same VPS.  
Are you able to that?  
What OS do you prefer?  
- I have 10 ips.
- I want them to be as much anonymous as you can.
- I would have an Username and Password as auth, but if needed the possibility to have an IP authentication too.
My budget is: ~20$  
Thank you in advance.  

说老实话,10个IP没必要,一个IP足够了,用Tor+polipo即可。

Tor的部分,用完全命令行加参数启动:

$ mkdir -p /tmp/tor10001/data
$ /usr/bin/tor SOCKSPort 10001 CONTROLPort 20001 DATADirectory /tmp/tor10001/data

Polipo的部分,也完全用命令行启动:

$ polipo socksParentProxy="127.0.0.1:10001" proxyPort=30001 proxyAddress="0.0.0.0" authCredentials="username:password"

组合起来,弄成一个脚本:

$ mkdir -p /tmp/tor10002/data
$ nohup /usr/bin/tor SOCKSPort 10002 CONTROLPort 20002 DATADirectory /tmp/tor10002/data &
$ nohup polipo socksParentProxy="127.0.0.1:10002" proxyPort=30002 proxyAddress="0.0.0.0" authCredentials="username:password" &

开100个Tor+Polipo:

#!/bin/bash

a=10001  
b=20001  
c=30001  
n=10100

echo "Start multiple Tors+polipo"  
echo "Begin port " $a  
echo "End port " $n

while [ $a -le $n ]  
do  
    echo "Start Tor on port" $a
    mkdir -p /tmp/tor$a/data
    nohup /usr/bin/tor SOCKSPort $a CONTROLPort $b DATADirectory /tmp/tor$a/data &
    echo "Start Polipo on port" $c
    nohup polipo socksParentProxy="127.0.0.1:$a" proxyPort=$c proxyAddress="0.0.0.0" authCredentials="username:password" &

    a=$(($a + 1)) 
    b=$(($b + 1)) 
    c=$(($c + 1))
done  

通杀Tor+Polipo的脚本

#!/bin/bash
ps aux | grep tor | awk '{print $2}' | xargs kill -9  
ps aux | grep polipo | awk '{print $2}' | xargs kill -9  
comments powered by Disqus