Enterprise Unlimited Solution

How to use our proxy | developers

Info A user account & free bandwidth required to use our proxy network. you must register your IP address in "Manage IPs" section.

Warning Any illegal activities is forbidden

In php we got two main options using proxy. the first one is file_get_contents and the secound is cURL.

file_get_contents - It is a function to get the contents of a file (basic view source items i.e out put html file contents)

curl - It is a library to do more operations, for example get the contents like file_get_contents, sending and receiving data from one site to another site and it also supports different types of protocols like http, https, ftp, gopher, telnet, dict, file, and ldap. curl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading HTTP form based upload, proxies, cookies

See more at knowledgecornor

PHP. file_get_contents

// PHP file_get_contents proxy example
// http://rev.proxies.online

// Our reverse proxy hostname + port, check your address in Dashboard
$p2p_proxy_addr = "rev1.proxies.online:8081";

// Target URL
$url = "http://www.google.com";

// Create file_get_contents context stream
$proxy_context_array = array(
	'http' => array(
		'proxy' => $p2p_proxy_addr, 
		'request_fulluri' => TRUE
	)
);
$proxy_context = stream_context_create($proxy_context_array);

// Use context stream with file_get_contents
$data = file_get_contents($url, FALSE, $context);

 

PHP. cURL

// PHP cURL proxy example
// http://rev.proxies.online

// Our reverse proxy hostname + port, check your address in Dashboard
$p2p_proxy_addr = "rev1.proxies.online:8081";

// Target URL
$url = "http://www.google.com";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_PROXY, $p2p_proxy_addr);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);

 

The urllib, urllib2, and urlparse modules have been combined in the urllib package in Python 3.

The urllib and urllib2 modules have not only been merged, but reorganized into several sub-modules. So there you need to import each name you use separately.

Python. version 2.x

# Python 2 proxy example
# http://rev.proxies.online

import urllib2

# Our reverse proxy hostname + port, check your address in Dashboard
p2p_proxy_addr = 'rev1.proxies.online:8081'

proxy = urllib2.ProxyHandler({
    'http': p2p_proxy_addr,
    'https': p2p_proxy_addr
})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)

urllib2.urlopen('http://www.google.com')
urllib2.urlopen('https://www.google.com')

 

Python. version 3.x

# Python 3 proxy example
# http://rev.proxies.online

import urllib.request as req

# Our reverse proxy hostname + port, check your address in Dashboard
p2p_proxy_addr = 'rev1.proxies.online:8081'

proxy = req.ProxyHandler({
    'http': p2p_proxy_addr,
    'https': p2p_proxy_addr
})
opener = req.build_opener(proxy)
req.install_opener(opener)

req.urlopen('http://www.google.com')
req.urlopen('https://www.google.com')

 

# Ruby proxy example
# http://rev.proxies.online

require "uri"
require 'net/http'

# Our reverse proxy hostname + port, check your address in Dashboard
p2p_proxy_addr = 'rev1.proxies.online'
p2p_proxy_port = '8081'

uri = URI.parse("http://www.google.com")
proxy = Net::HTTP::Proxy(p2p_proxy_addr, p2p_proxy_port)

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
http.request(req)
end

puts result.body

 

In Java with got few options to deal with proxies, we select the main options.

Java. global proxy

// Java global proxy example
// http://rev.proxies.online

System.setProperty("proxySet", "true");

// Our reverse proxy hostname + port, check your address in Dashboard
System.setProperty("http.proxyHost", "rev1.proxies.online");
System.setProperty("http.proxyPort", "8081");

URL url = new URL("http://www.google.com/");
URLConnection con = url.openConnection();

 

Java. apache HttpClient

// Java Apache HttpClient proxy example
// http://rev.proxies.online

String p2p_proxy_addr = "rev1.proxies.online";
int p2p_proxy_port = 8081;

DefaultHttpClient httpclient = new DefaultHttpClient();

HttpHost proxy = new HttpHost(p2p_proxy_addr, p2p_proxy_port, "http");
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
 
HttpGet httpget = new HttpGet("http://www.google.com");
 
HttpResponse response = httpclient.execute(httpget);

 

Essential SSL