curl https://unlocker-api.lunaproxy.com/request -H "Content-Type: application/json" -H "Authorization: Bearer {{apiToken}}" -d "{\"url\": \"{{targetUrl}}\", \"country\": \"{{countryCode == 'all' ? '' : countryCode}}\"}"
echo -e "\n\nThis is the VERBOSE version sample cURL code for Web Unlocker.\nIn order to instantly use Web Unlocker, you need to either install an SSL certificate\nor to ignore SSL errors in your code.\n\nThis cURL includes the '-k' option to ignore SSL errors.\n\nPress Enter to continue..." && read input && echo -e "\nThanks. I am going to run the following cURL command now:\n" && echo "curl -i --proxy {{host}}:{{port}} --proxy-user {{userText}}:{{password}} -k \"{{targetUrl}}\"" && echo -e "\nCopy this cURL if you want to run it in non-verbose mode.\n\nHere's the result of the cURL:\n" && curl -i --proxy {{host}}:{{port}} --proxy-user {{userText}}:{{password}} -k "{{targetUrl}}" && echo -e "\n\nFor additional information visit:\nhttps://docs.brightdata.com/general/account/ssl-certificate\n"
curl -i --proxy {{host}}:{{port}} --proxy-user {{userText}}:{{password}} -k "{{targetUrl}}"
#!/usr/bin/env node
/*This sample code assumes the request-promise package is installed. If it is not installed run: "npm install request-promise"*/
require('request-promise')({
url: '{{targetUrl}}',
proxy: 'http://{{userText}}:{{password}}@{{host}}:{{port}}',
rejectUnauthorized: false,
}).then(
function(data){ console.log(data); },
function(err){ console.error(err); },
);
#!/usr/bin/env python
print('If you get error "ImportError: No module named \'six\'" install six:\n'+\
'$ sudo pip install six');
print('To enable your free eval account and get CUSTOMER, YOURZONE and ' + \
'YOURPASS, please contact [email protected]')
import sys
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
if sys.version_info[0]==2:
import six
from six.moves.urllib import request
opener = request.build_opener(
request.ProxyHandler(
{'http': 'http://{{userText}}:{{password}}@{{host}}:{{port}}',
'https': 'http://{{userText}}:{{password}}@{{host}}:{{port}}'}))
print(opener.open('{{targetUrl}}').read())
if sys.version_info[0]==3:
import urllib.request
opener = urllib.request.build_opener(
urllib.request.ProxyHandler(
{'http': 'http://{{userText}}:{{password}}@{{host}}:{{port}}',
'https': 'http://{{userText}}:{{password}}@{{host}}:{{port}}'}))
print(opener.open('{{targetUrl}}').read())
using System;
using System.Net;
class Example
{
static void Main()
{
Console.WriteLine("To enable your free eval account and get CUSTOMER, "
+"YOURZONE and YOURPASS, please contact [email protected]");
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
var client = new WebClient();
client.Proxy = new WebProxy("{{host}}:{{port}}");
client.Proxy.Credentials = new NetworkCredential("{{userText}}", "{{password}}");
Console.WriteLine(client.DownloadString("{{targetUrl}}"));
}
}
#!/usr/bin/ruby
require 'uri'
require 'net/http'
require 'net/https'
puts 'To enable your free eval account and get CUSTOMER, YOURZONE and YOURPASS, please contact [email protected]'
uri = URI.parse('{{targetUrl}}')
proxy = Net::HTTP::Proxy('{{host}}', {{port}}, '{{userText}}', '{{password}}')
req = Net::HTTP::Get.new(uri)
result = proxy.start(uri.host,uri.port, :use_ssl => uri.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|
http.request(req)
end
puts result.body
package example;
import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;
public class Example {
public static void main(String[] args) throws Exception {
System.out.println("To enable your free eval account and get "
+"CUSTOMER, YOURZONE and YOURPASS, please contact "
+"[email protected]");
HttpHost proxy = new HttpHost("{{host}}", {{port}});
String res = Executor.newInstance()
.auth(proxy, "{{userText}}", "{{password}}")
.execute(Request.Get("{{targetUrl}}").viaProxy(proxy))
.returnContent().asString();
System.out.println(res);
}
}
Imports System.Net
Module Module1
Sub Main()
Console.WriteLine("To enable your free eval account and get " &
"CUSTOMER, YOURZONE and YOURPASS, please contact " &
"[email protected]")
ServicePointManager.ServerCertificateValidationCallback = Function(se, cert, chain, sslerror) True
Dim Client As New WebClient
Client.Proxy = New WebProxy("http://{{host}}:{{port}}")
Client.Proxy.Credentials = New NetworkCredential("{{userText}}", "{{password}}")
Console.WriteLine(Client.DownloadString("{{targetUrl}}"))
End Sub
End Module
<?php
echo 'To enable your free eval account and get CUSTOMER, YOURZONE and '
.'YOURPASS, please contact [email protected]';
$curl = curl_init('{{targetUrl}}');
curl_setopt($curl, CURLOPT_PROXY, 'http://{{host}}:{{port}}');
curl_setopt($curl, CURLOPT_PROXYUSERPWD, '{{userText}}:{{password}}');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_exec($curl);
?>
#!/usr/bin/perl
print 'To enable your free eval account and get CUSTOMER, YOURZONE and '
.'YOURPASS, please contact [email protected]';
use LWP::UserAgent;
use IO::Socket::SSL qw( SSL_VERIFY_NONE );
my $agent = LWP::UserAgent->new();
$agent->proxy(['http', 'https'], "http://{{userText}}:{{password}}\@{{host}}:{{port}}");
$agent->ssl_opts(verify_hostname => 0, SSL_verify_mode => SSL_VERIFY_NONE);
print $agent->get('{{targetUrl}}')->content();
Please Contact Customer Service by Email
We will reply you via email within 24h