Skip to main content
All CollectionsSoftware Tutorials
Setting Up SimplyNode Proxies Using cURL, PHP, .NET, C#, or Python
Setting Up SimplyNode Proxies Using cURL, PHP, .NET, C#, or Python
SimplyNode Support avatar
Written by SimplyNode Support
Updated this week

Proxies can be essential for managing web requests, bypassing geo-restrictions, or maintaining anonymity. Here's how you can set up a proxy in various programming environments.

Using cURL

For Login/Password Authorization:

login - your username/login from the SimplyNode dashboard

wifi;us;;; - example of a password to connect to a US proxy. You can generate a password in the SimplyNode dashboard.

proxy.simplynode.io - the server address.

9100 - example of a port number; you can use any port within the range of 9000 - 19999.

http://api.ipify.org - an example of a website you can request.

MacOS:

To use a proxy with cURL on Mac, add the -x or --proxy option followed by the proxy server details:

curl -x "http://login:wifi;us;;;@proxy.simplynode.io:9150" -L http://api.ipify.org

Windows:

On Windows, the syntax is similar. Ensure your terminal supports cURL commands:

curl -x "http://login:wifi;us;;;@proxy.simplynode.io:9150" -L "http://api.ipify.org"

PHP Proxy Setup

Using PHP's cURL extension, you can easily route your web requests through a proxy server:

<?php
$auth = base64_encode('login:wifi;us;');
$aContext = array(
'http' => array(
'proxy' => 'tcp://proxy.simplynode.io:9100',
'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";
?>

Configuring Proxies in .NET or C# (with Rebex HTTP library):

In .NET or C#, you can use the WebProxy class to configure a proxy:

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.simplynode.io";
client.Proxy.Port = 9100;
client.Proxy.UserName = "login";
client.Proxy.Password = "wifi;us;;;";

var url = "http://api.ipify.org";

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();
}
}
}

Setting Up a Proxy in Python

Python’s popular requests library makes proxy setup simple. Here’s a basic example:

import requests as req

proxy = {
"http": "http://login:wifi;us;@proxy.simplynode.io:9100",
"https": "http://login:wifi;us;@proxy.simplynode.io:9100"
}

resp = req.get("http://api.ipify.org",proxies=proxy)

print(resp.text)

Conclusion

Configuring proxies in these environments helps you manage web traffic, secure connections, and navigate restrictions. Choose the language that suits your needs and follow the steps to get started. If you need more detailed guidance or encounter any issues, our Help Center is here to help!

Got a question?
Our friendly support team is just a message away. Drop us a line anytime via live chat in the bottom right corner.

Did this answer your question?