1. Go to this page and download the library: Download jtanjung/proxier library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jtanjung / proxier example snippets
use Proxier\ProxySeeder;
$seeder = new ProxySeeder();
$proxy = $seeder->FreeProxyListNet();
$proxy->SetTimeOut(60);
$proxy->Seed();
use Proxier\ProxySeeder;
$seeder = new ProxySeeder();
// Try to get random proxy from the cache
echo "Get a random proxy....\n";
// Call Get function to get a random entry, or pass md5 value of IP:Port
$proxy = $seeder->Seed()->Get();
echo json_encode($proxy) . "\n";
use Proxier\ProxySeeder;
$seeder = new ProxySeeder();
$seeder->Bind('OnLoading', function(){
echo "Start seeding, please wait...\n";
});
$seeder->Bind('OnSeeding', function($value){
echo json_encode($value) . "\n";
// You can put block code here to insert the new proxy to database
/** ->Save([
* "ip" => $value->IP,
* "port" => $value->Port
* "location" => $value->Location
* ]);
*/
});
$seeder->Bind('OnComplete', function($value){
echo "\nComplete...\n";
echo $value->count() ." proxy found.";
});
$seeder->Bind('OnError', function($msg, $exc){
echo "Message = '$msg'\n";
// throw $exc;
});