Proxy-in-a-Box helps programmers quickly and easily develop powerful crawler services. one-script, easy-to-use: proxies in a box.
Usage:
proxy-in-a-box [flags]
Flags:
-c, --conf string config file (default "./pb.yaml")
-p, --ha string http proxy server addr (default "127.0.0.1:8080")
-h, --help help for proxy-in-a-box
-s, --sa string https proxy server addr (default "127.0.0.1:8081")
- get lastest Proxy-in-a-Box
go get -u -v github.com/naiba/proxyinabox/cmd/proxy-in-a-box/...
- enter the application directory
cd $GOPATH/bin
- write config file #Config
- run it
./proxy-in-a-box
- configured in your code
Set in the code, and then grab it, the Proxy-in-a-Box will automatically assign the proxy.
HTTP proxy: `http://[IP]:8080` HTTPS proxy: `https://[IP]:8081` * Please set http header when requesting: "Naiba: lifelonglearning" ref:https://github.com/naiba/proxyinabox/blob/master/cmd/proxy-in-a-box/test_server.sh
# run in debug mode
debug: true
# mysql config
mysql:
host: 127.0.0.1
port: 3306
user: root
pass: 123456
dbname: proxy
# system config
sys:
name: Naiba
# verify proxy's worker num
proxy_verify_worker: 20
# how many domains can request per ip in 30min
domains_per_ip: 30
# how many request can do per ip in 1s
request_limit_per_ip: 10
# verify interval of the proxy stored in the database
verify_duration: 30
ab -H 'Naiba: lifelonglearning' -v4 -n100 -c10 -X 127.0.0.1:8080 http://api.ip.la/cn