Skip to content
Intermediate / 4 min read

How to Use ProxyScrape SOCKS5 Proxies on Windows Terminal and PowerShell for Web Scraping

A practical guide to configuring ProxyScrape SOCKS5 proxies for command-line tools on Windows, including curl, Windows Terminal, and PowerShell, with rotation strategies for web scraping.

Windows SOCKS5 HTTP(S) Web Scraping

Overview

This tutorial shows you how to configure ProxyScrape SOCKS5 proxies for command-line tools on Windows, including Windows Terminal, PowerShell, and curl. SOCKS5 is a versatile proxy protocol that can handle any type of traffic, making it ideal for web scraping, API testing, and automation. We'll cover testing your proxy, setting environment variables, and rotating proxies for large-scale scraping.

ProxyScrape offers residential, datacenter, and mobile proxies with HTTP and SOCKS5 support. Their pool of 97M+ IPs and reliable uptime make them a solid choice for teams that need dependable infrastructure.

Prerequisites

Before you begin, ensure you have:

  • An active ProxyScrape subscription (residential, datacenter, or mobile).
  • Your ProxyScrape SOCKS5 endpoint details: host, port, username, and password.
  • Windows 10 or 11 with Windows Terminal (or Command Prompt) and PowerShell.
  • curl installed. Windows 10 (version 1803+) and Windows 11 include curl by default. If not, download it from the official curl website.

Steps

1. Retrieve Your ProxyScrape SOCKS5 Endpoint

Log in to your ProxyScrape dashboard and navigate to the proxy list or endpoint section. Select SOCKS5 as the protocol, then copy the host, port, username, and password for your chosen proxy type (residential, datacenter, or mobile). You may also see a list of multiple endpoints if you have a rotating plan.

2. Test the Proxy with curl in Windows Terminal

Open Windows Terminal (or Command Prompt) and run a simple curl command to verify the proxy works. Use the --socks5-hostname flag to route DNS through the proxy as well.

curl --socks5-hostname username:password@host:port https://httpbin.org/ip

Replace username, password, host, and port with your actual credentials. If successful, the response will show the proxy's IP address instead of your own.

3. Set Up Environment Variables for System-Wide Proxy Usage

Many command-line tools respect the ALL_PROXY environment variable. In PowerShell, you can set it for the current session:

$env:ALL_PROXY = "socks5://username:password@host:port"

For Command Prompt, use:

set ALL_PROXY=socks5://username:password@host:port

To make it permanent, add it to your system environment variables via the Windows Settings or using setx. Note that not all tools support SOCKS5 via environment variables, but curl, wget, and many others do.

4. Use ProxyScrape SOCKS5 with curl for Web Scraping

With the proxy configured, you can fetch web pages. For example, to save a page to a file:

curl --socks5-hostname username:password@host:port -o output.html https://example.com

If you have a list of proxies (e.g., a rotating endpoint list from ProxyScrape), you can loop through them in a script.

5. Route PowerShell's Invoke-WebRequest Through ProxyScrape

PowerShell's Invoke-WebRequest does not natively support SOCKS5. If you need to use PowerShell cmdlets, use an HTTP proxy instead. ProxyScrape also provides HTTP proxies; you can use your HTTP endpoint with Invoke-WebRequest:

Invoke-WebRequest -Uri "https://example.com" -Proxy "http://username:password@host:port"

For SOCKS5 in PowerShell, call curl.exe directly as shown in step 2.

6. Use ProxyScrape SOCKS5 with Python requests (Optional)

If you use Python for scraping, install the requests library with SOCKS support:

pip install requests[socks]

Then use the proxy in your script:

import requests

proxies = {
    'http': 'socks5://username:password@host:port',
    'https': 'socks5://username:password@host:port'
}
response = requests.get('https://httpbin.org/ip', proxies=proxies)
print(response.text)

7. Rotate Proxies for Large-Scale Scraping

For large jobs, rotate through multiple proxies to avoid rate limits. Create a text file proxies.txt with one proxy per line in host:port:username:password format. Then use a PowerShell script to iterate:

$proxies = Get-Content proxies.txt
foreach ($proxy in $proxies) {
    $parts = $proxy -split ':'
    $host = $parts[0]
    $port = $parts[1]
    $user = $parts[2]
    $pass = $parts[3]
    $proxyUrl = "socks5://${user}:${pass}@${host}:${port}"
    $env:ALL_PROXY = $proxyUrl
    curl.exe -s --socks5-hostname "${user}:${pass}@${host}:${port}" https://httpbin.org/ip
}

Adjust the script to suit your scraping target.

Troubleshooting

  • Connection refused: Verify the host and port are correct and that your IP is whitelisted if required.
  • Authentication failed: Double-check your username and password. Special characters may need URL encoding (e.g., @ becomes %40).
  • DNS resolution errors: Always use --socks5-hostname with curl to let the proxy resolve DNS.
  • Slow performance: Try datacenter proxies for speed; residential proxies are stealthier but slower.
  • Environment variables not working: Some tools ignore ALL_PROXY. Use command-line flags instead.

Summary

You've learned how to use ProxyScrape SOCKS5 proxies with command-line tools on Windows, including curl, Windows Terminal, and PowerShell. We covered testing your proxy, setting environment variables, rotating proxies for scraping, and workarounds for PowerShell cmdlets. ProxyScrape's reliable infrastructure and large pool of 97M+ IPs make it a strong choice for web scraping and automation. For more advanced setups, consider using their residential proxies for stealth or datacenter proxies for high-speed tasks.