Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo htpasswd /etc/squid3/squid_passwd myusername
- auth_param basic program /usr/lib/squid3/ncsa_auth /etc/squid3/squid_passwd
- auth_param basic credentialsttl 2 hours
- auth_param basic casesensitive off
- acl ncsa_users proxy_auth REQUIRED
- http_access allow ncsa_users
- /usr/lib/squid3/ncsa_auth /et/squid3/squid_passwd
- myusername password
- OK
- $proxy = "111.11.11.11:8220"; // my squid ip and port
- $proxyauth = base64_encode('username:pass'); // Tried without base64_encode also
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL,$url);
- curl_setopt($ch, CURLOPT_PROXY, $proxy);
- curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- $curl_scraped_page = curl_exec($ch);
- echo $curl_scraped_page;
- if(curl_error($ch))
- {
- echo 'error:' . curl_error($ch);
- }
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement