#!/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: 'http://brdtest.com/myip.json', proxy: 'http://brd-customer-<customer_id>-zone-<zone_name>:<zone_password>@brd.superproxy.io:33335', // Make sure you set reject rejectUnauthorized to false rejectUnauthorized: false,}).then(function(data){ console.log(data); }, function(err){ console.error(err); });
#!/usr/bin/env pythonprint('If you get error "ImportError: No module named \'six\'" install six:\n'+\ '$ sudo pip install six');import sys# Make sure you add these two line to ignore ssl errorimport sslssl._create_default_https_context = ssl._create_unverified_contextif sys.version_info[0]==2: import six from six.moves.urllib import request opener = request.build_opener( request.ProxyHandler( {'http': 'http://brd-customer-<customer_id>-zone-<zone_name>:<zone_password>@brd.superproxy.io:33335', 'https': 'http://brd-customer-<customer_id>-zone-<zone_name>:<zone_password>@brd.superproxy.io:33335'})) print(opener.open('http://brdtest.com/myip.json').read())if sys.version_info[0]==3: import urllib.request opener = urllib.request.build_opener( urllib.request.ProxyHandler( {'http': 'http://brd-customer-<customer_id>-zone-<zone_name>:<zone_password>@brd.superproxy.io:33335', 'https': 'http://brd-customer-<customer_id>-zone-<zone_name>:<zone_password>@brd.superproxy.io:33335'})) print(opener.open('http://brdtest.com/myip.json').read())
using System;using System.Net;class Example{ static void Main() { // Make sure you add this line to ignore ssl error ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; var client = new WebClient(); client.Proxy = new WebProxy("brd.superproxy.io:33335"); client.Proxy.Credentials = new NetworkCredential("brd-customer-<customer_id>-zone-<zone_name>", "<zone_password>"); Console.WriteLine(client.DownloadString("http://brdtest.com/myip.json")); }}
package example;import org.apache.http.HttpHost;import org.apache.http.client.fluent.*;public class Example { public static void main(String[] args) throws Exception { HttpHost proxy = new HttpHost("brd.superproxy.io", 33335); String res = Executor.newInstance() .auth(proxy, "brd-customer-<customer_id>-zone-<zone_name>", "<zone_password>") .execute(Request.Get("http://brdtest.com/myip.json").viaProxy(proxy)) .returnContent().asString(); System.out.println(res); }}/*In the above example, we are not explicitly ignoring SSLI will share with you a short code I wrote that does ignore SSL using JAVA (was taken from cloud proxy manager examples) */import java.io.*;import java.net.*;import java.security.cert.X509Certificate;import javax.net.ssl.*;import java.util.Base64;public class Example { public static void main(String[] args) throws Exception { // Disable restricted headers for proxy authentication System.setProperty("jdk.http.auth.tunneling.disabledSchemes", ""); // Set up a TrustManager that does not validate certificate chains SSLContext sc = SSLContext.getInstance("SSL"); TrustManager trust_manager = new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String authType) { } public void checkServerTrusted(X509Certificate[] certs, String authType) { } }; TrustManager[] trust_all = new TrustManager[] { trust_manager }; sc.init(null, trust_all, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); // Set up the proxy and open a connection URL url = new URL("https://geo.brdtest.com/mygeo.json"); Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("brd.superproxy.io", 33335)); URLConnection yc = url.openConnection(proxy); // Set default Authenticator for proxy authentication Authenticator.setDefault(new Authenticator() { @Override public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication("brd-customer-<customer_id>-zone-<zone_name>", "<zone_password>".toCharArray()); } }); // Read and print the response from the server BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) System.out.println(inputLine); in.close(); }}
Imports System.NetModule Module1 Sub Main() ' Make sure you add this line to ignore ssl error ServicePointManager.ServerCertificateValidationCallback = Function(se, cert, chain, sslerror) True Dim Client As New WebClient Client.Proxy = New WebProxy("http://brd.superproxy.io:33335") Client.Proxy.Credentials = New NetworkCredential("brd-customer-<customer_id>-zone-<zone_name>", "<zone_password>") Console.WriteLine(Client.DownloadString("http://brdtest.com/myip.json")) End SubEnd Module
<?php$curl = curl_init('http://brdtest.com/myip.json');curl_setopt($curl, CURLOPT_PROXY, 'http://brd.superproxy.io:33335');curl_setopt($curl, CURLOPT_PROXYUSERPWD, 'brd-customer-<customer_id>-zone-<zone_name>:<zone_password>');// Make sure you add this line to ignore ssl errorcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);curl_exec($curl);?>
#!/usr/bin/perluse LWP::UserAgent;# Make sure you add this line to ignore ssl erroruse IO::Socket::SSL qw( SSL_VERIFY_NONE );my $agent = LWP::UserAgent->new();$agent->proxy(['http', 'https'], "http://brd-customer-<customer_id>-zone-<zone_name>:<zone_password>\@brd.superproxy.io:33335");$agent->ssl_opts(verify_hostname => 0, SSL_verify_mode => SSL_VERIFY_NONE);print $agent->get('http://brdtest.com/myip.json')->content();