Skip to main content
All CollectionsNew Dashboard Guides
Proxy set up using CURL, PHP, .NET with C# or Python (beta)
Proxy set up using CURL, PHP, .NET with C# or Python (beta)

Different ways to test and connect to SOAX proxies

Oleg avatar
Written by Oleg
Updated over a month ago

Note: This article is relevant only for users of the new dashboard.
If you use the older dashboard version, please refer to the article here for the applicable instructions.

In this article, you will learn about the simplest ways to start testing or using SOAX proxies without browser extensions. The article provides the following testing methods:

Please note that "package-256478" (part of login) and "6yO9bR2syuwlhvtb" (password) taken from test account, which cannot be used in real-life scenarios. You must use your credentials instead. Also, note that "country-us" is a part of test login that sets up the target region and with each new setting change you should update login in code below.

1.cURL

in Linux:

launch Terminal/Bash and execute the request:

curl -k -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L https://checker.soax.com/api/ipinfo

A successfully completed request looks like this:

$ curl -k -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L https://checker.soax.com/api/ipinfo 

{"status":true,"reason":"","data":{"carrier":"","city":"Melbourne","country_code":"US","country_name":"United States","ip":"97.102.236.127","isp":"Spectrum","region":"Florida"}}

in MacOS:

launch Terminal and execute the request:

curl -k -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L https://checker.soax.com/api/ipinfo

A successfully completed request looks like this:

user@mac ~ % curl -k -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L https://checker.soax.com/api/ipinfo

{"status":true,"reason":"","data":{"carrier":"","city":"Melbourne","country_code":"US","country_name":"United States","ip":"97.102.236.127","isp":"Spectrum","region":"Florida"}}

in Windows 10:

1) type "control" in the search box and open Control Panel:

2) select "Programs and Features":

3) select "Turn Windows features on or off":

4) mark the "Windows Subsystem for Linux" checkbox:

5) now, you can use "CURL" by running cmd.exe. The command should look like this:

curl -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L http://checker.soax.com/api/ipinfo 

The executed command looks like this:

C:\>curl -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L http://checker.soax.com/api/ipinfo 

{"status":true,"reason":"","data":{"carrier":"","city":"Melbourne","country_code":"US","country_name":"United States","ip":"97.102.236.127","isp":"Spectrum","region":"Florida"}}

in previous Windows versions:

1) install CURL using one of the methods below:

2) run cmd.exe and execute the command:

curl -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L https://checker.soax.com/api/ipinfo

The executed command looks like this:

C:\cygwin64\bin>curl -x package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000 -L https://checker.soax.com/api/ipinfo

{"status":true,"reason":"","data":{"carrier":"","city":"Melbourne","country_code":"US","country_name":"United States","ip":"97.102.236.127","isp":"Spectrum","region":"Florida"}}

2. PHP

<?php
$auth = base64_encode('package-256478-country-us-sessionid-number01-sessionlength-300:6yO9bR2syuwlhvtb');
$aContext = array(
'http' => array(
'proxy' => 'tcp://proxy.soax.com:5000',
'request_fulluri' => true,
'header' => "Proxy-Authorization: Basic $auth",
),
);
$cxContext = stream_context_create($aContext);
$sFile = file_get_contents("http://api.ipify.org", False, $cxContext);
echo $sFile, "\n";
?>

Code execution example (tested on Ubuntu 18.04.3 LTS with PHP 5.6):

$ php proxy_test.php

{"ip":"97.102.236.127"}

3. .NET Framework using C# (with Rebex HTTP library)

using Rebex.Net;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Rebex.Licensing.Key = "ENTER YOUR LICENSING KEY HERE";

var client = new Rebex.Net.HttpRequestCreator();

client.Proxy.ProxyType = ProxyType.Socks5;
client.Proxy.Host = "proxy.soax.com";
client.Proxy.Port = 5000;
client.Proxy.UserName = "package-256478-country-us-sessionid-number01-sessionlength-300";
client.Proxy.Password = "6yO9bR2syuwlhvtb";

var url = "http://checker.soax.com/api/ipinfo";

var httpRequest = client.Create(url);
httpRequest.Headers["Accept"] = "text/html, application/xhtml+xml, image/jxr, */*";
httpRequest.Headers["Accept-Language"] = "en-US,en;q=0.7,ru;q=0.3";
httpRequest.Headers["Accept-Encoding"] = "gzip, deflate";
httpRequest.Headers["Host"] = url;
httpRequest.Headers["Connection"] = "Keep-Alive";
httpRequest.Timeout = 30000;

try
{
var response = httpRequest.GetResponse() as Rebex.Net.HttpResponse;

using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
var content = sr.ReadToEnd();
Console.WriteLine("Url: " + url + " \n" + "Content length: " + content.Length + "\n" + "Response: \n" + content);
}
}
catch (Exception e)
{
Console.WriteLine("Url " + url + " is failed. \n" + e.Message);
}
Console.ReadKey();
}
}
}

4. Python

Python version 2.7 or 3.6 (using Requests library):

import requests as req

proxy = {
"http": "http://package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000",
"https": "http://package-256478-country-us-sessionid-number01-sessionlength-300:[email protected]:5000"
}

resp = req.get("https://checker.soax.com/api/ipinfo",proxies=proxy)

print(resp.text)

Code execution example on version 2.7 and 3.6, respectively (tested on Ubuntu 18.04.3 LTS):

$ python2.7 proxy_test.py

{"status":true,"reason":"","data":{"carrier":"","city":"Melbourne","country_code":"US","country_name":"United States","ip":"97.102.236.127","isp":"Spectrum","region":"Florida"}}

$ python3.6 proxy_test.py

{"status":true,"reason":"","data":{"carrier":"","city":"Melbourne","country_code":"US","country_name":"United States","ip":"97.102.236.127","isp":"Spectrum","region":"Florida"}}

Did this answer your question?