import requests
username = "USER-zone-datacenter"
password = "PASS"
proxy = "gw.databay.co:8888"
proxies = {
'http': f'http://{username}:{password}@{proxy}',
'https': f'http://{username}:{password}@{proxy}'
}
response = requests.request(
'GET',
'https://databay.com/cdn-cgi/trace',
proxies=proxies,
)
const axios = require('axios');
const username = 'USER-zone-datacenter';
const password = 'PASS';
const proxy = 'gw.databay.co:8888';
const proxyURL = `http://${username}:${password}@${proxy}`;
const httpsAgent = new HttpsProxyAgent(proxyURL);
const httpAgent = new HttpProxyAgent(proxyURL);
const response = await axios({
method: 'GET',
url: 'https://databay.com/cdn-cgi/trace',
httpsAgent,
httpAgent
});
<?php
$username = 'USER-zone-datacenter';
$password = 'PASS';
$proxy = 'gw.databay.co:8888';
$auth = base64_encode("$username:$password");
$curl = curl_init('https://databay.com/cdn-cgi/trace');
curl_setopt($curl, CURLOPT_PROXY, $proxy);
curl_setopt($curl, CURLOPT_PROXYUSERPWD, "$username:$password");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
package main
import (
"fmt"
"net/http"
"net/url"
)
func main() {
username := "USER-zone-datacenter"
password := "PASS"
proxyURL := fmt.Sprintf("http://%s:%[email protected]:8888", username, password)
proxyURLParsed, _ := url.Parse(proxyURL)
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURLParsed),
},
}
resp, _ := client.Get("https://databay.com/cdn-cgi/trace")
defer resp.Body.Close()
// Process response...
}
import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ProxyExample {
public static void main(String[] args) throws Exception {
String username = "USER-zone-datacenter";
String password = "PASS";
System.setProperty("http.proxyHost", "gw.databay.co");
System.setProperty("http.proxyPort", "8888");
System.setProperty("https.proxyHost", "gw.databay.co");
System.setProperty("https.proxyPort", "8888");
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password.toCharArray());
}
});
HttpClient client = HttpClient.newBuilder().build();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://databay.com/cdn-cgi/trace"))
.GET()
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
}
}
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string username = "USER-zone-datacenter";
string password = "PASS";
string proxyUrl = "gw.databay.co:8888";
var handler = new HttpClientHandler
{
Proxy = new WebProxy
{
Address = new Uri($"http://{proxyUrl}"),
Credentials = new NetworkCredential(username, password)
},
UseProxy = true
};
using var client = new HttpClient(handler);
var response = await client.GetAsync("https://databay.com/cdn-cgi/trace");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}