0% found this document useful (0 votes)
104 views

New Webshare Code

This document provides code for generating a Webshare proxy token and testing the connectivity of Webshare proxies. It includes code to: 1. Generate a Webshare token from the Webshare dashboard API keys. 2. Make a cURL request to retrieve a random proxy from the Webshare proxy list using the token. 3. Test the retrieved proxy by making a cURL request to an IP lookup service and check if a public IP is returned, indicating the proxy is active. The code also shows how to configure cURL requests to use the Webshare proxy for requests.

Uploaded by

vostderzhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

New Webshare Code

This document provides code for generating a Webshare proxy token and testing the connectivity of Webshare proxies. It includes code to: 1. Generate a Webshare token from the Webshare dashboard API keys. 2. Make a cURL request to retrieve a random proxy from the Webshare proxy list using the token. 3. Test the retrieved proxy by making a cURL request to an IP lookup service and check if a public IP is returned, indicating the proxy is active. The code also shows how to configure cURL requests to use the Webshare proxy for requests.

Uploaded by

vostderzhe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

New Webshare Code

#################[Webshare Proxy]#######################

//How To Make Webshare Token First Make Your Webshare [FREE] OR [PAID] Acc
Then Go To Webshare Dashboard.
//Dashboard There You Get One Button With Then Name Of API Go There And
Select Keys Make Token From There.

$web = array(
1 => '.......', //2a952592de542903da4c865330b95795db1ffdcb
);
$share = array_rand($web);
$webshare_token = $web[$share];

$prox = curl_init();
curl_setopt($prox, CURLOPT_URL,
'https://proxy.webshare.io/api/proxy/list/');
curl_setopt($prox, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($prox, CURLOPT_CUSTOMREQUEST, 'GET');
$headers = array();
$headers[] = 'Authorization: Token '.$webshare_token.'';
curl_setopt($prox, CURLOPT_HTTPHEADER, $headers);
$webshare = curl_exec($prox);

curl_close($prox);

$prox_res = json_decode($webshare, 1);


$count = $prox_res['count'];
$random = rand(0,$count-1);

$proxy_ip = $prox_res['results'][$random]['proxy_address'];
$proxy_port = $prox_res['results'][$random]['ports']['socks5'];
$proxy_user = $prox_res['results'][$random]['username'];
$proxy_pass = $prox_res['results'][$random]['password'];

$proxy = ''.$proxy_ip.':'.$proxy_port.'';
$credentials = ''.$proxy_user.':'.$proxy_pass.'';
$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1)
Gecko/20061204 Firefox/2.0.0.1";

// FOR SHOWING IP OR PROXY ADD THIS IN Responses [IP :- '.$proxy.']

#################[Proxy Live Tester Made By Dragon


Master]#######################

$rotate = ''.$proxy_user.'-rotate:'.$proxy_pass.'';

$ip = array(
1 => 'socks5://p.webshare.io:1080',
2 => 'http://p.webshare.io:80',
);
$socks = array_rand($ip);
$socks5 = $ip[$socks];

$url = "https://api.ipify.org/";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $socks5);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $rotate);
$ip1 = curl_exec($ch);
curl_close($ch);
ob_flush();
if (isset($ip1)){
$ip = 'Live ✅';
}
if (empty($ip1)){
$ip = ' Dead:-'.$webshare_token.' | IP :- '.$proxy.' ';
}

echo '『 Proxy: '.$ip.' 』';

#################[Webshare Proxy End]#######################

Paste This In Your Requset or a [Req]

$ch = curl_init();
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,15);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($ch, CURLOPT_PROXYUSERPWD,$credentials);
curl_setopt($ch, CURLOPT_USERAGENT,$useragent);

########################################################

You might also like