Example addresses (203.0.113.0/24), not real exits
01 / 11Where the proxy goes in each language
One page, three languages: where the proxy address and the login go in Ruby, Rust and PowerShell, and how to confirm the proxy is used.
01
Where the proxy goes in each language
In all three languages the proxy needs the same four values: host, port, login and password. Ruby's Net::HTTP takes them as the last four arguments of Net::HTTP.new, Rust's reqwest takes a Proxy object with basic_auth, and PowerShell's Invoke-WebRequest and Invoke-RestMethod take -Proxy and -ProxyCredential.
The snippets use the HTTP port of the proxy, because that is the protocol these three standard tools document most plainly. reqwest also supports SOCKS5 once its socks feature is switched on. Every snippet calls https://ipinfo.io/json so you can read the exit IP.
Net::HTTP.new reads the http_proxy environment variable when you pass no proxy arguments, because the default for p_addr is :ENV, so a stray variable can send requests through a proxy you did not intend. PowerShell 7 reads HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY when -Proxy is not given.
With a rotating gateway a new IP appears with each new connection, not each request. Whether your client reuses a connection depends on the library, so test it: call ipinfo.io several times in a loop, count the distinct IPs and decide whether you need a fresh client object or a session.
Each snippet needs four values from a Proxy302 proxy: host, port, login and password. For scraping, rotating residential traffic is billed per GB (Budget line US$1.50 per GB, Premium line US$5 per GB); HTTP is on port 2222 and SOCKS5 on port 3333 of proxy.proxy302.com, and the same login works for both. Without a session, each new connection gets a new IP, and a connection you keep open keeps its IP.
When the other side needs one fixed address, a datacenter IP lease costs US$0.25 for 1 day or US$3.99 for 30 days, and you choose HTTP or SOCKS5 when you buy it. There is no free trial; the smallest purchase is 1 GB of rotating residential traffic or one IP for one day.
Open the rotating residential page, choose the line, then click Review cost and generate. For a fixed IP, buy a datacenter IP on the datacenter pay-per-IP page instead.
Step 2
Open My assets and copy HOST, PORT, USERNAME and PASSWORD exactly as they are shown there.
Step 3
Paste them into the code in this guide, using the port that matches the protocol: 2222 for HTTP, 3333 for SOCKS5.
Step 4
Run the code against https://ipinfo.io/json and check that the country and org fields describe the proxy, not your own connection.
Check Login and password copied from My assets without spaces; in Rust, basic_auth called on the Proxy; in PowerShell, a PSCredential rather than a plain string.
Fix Copy the values again and read the authentication guide.
Stop when If the same login also fails in curl, stop changing code and contact Support with the order number.
Connection refused or timeout
Check The port matches the protocol: 2222 for HTTP, 3333 for SOCKS5, and the URL starts with http:// for the HTTP port.
Fix Fix the port or scheme, then try again; the connection guide lists the other checks.
Stop when If every port times out from your network, test from another network before changing code.
The response shows your own IP
Check An environment variable or NO_PROXY entry is taking over; in Rust, Proxy::http was used for an https:// target.
Fix Print the effective settings, switch to Proxy::all, and remove stray variables.
Stop when If ipinfo still shows your IP with the proxy set in code, check that the request really uses that client object.
FAQ
How do I use a proxy with a username and password in Ruby Net::HTTP?
Pass them to Net::HTTP.new after the address and port: Net::HTTP.new(host, port, proxy_host, proxy_port, proxy_user, proxy_pass). The Net::HTTP source documents these arguments.
Does reqwest support SOCKS5 proxies?
Yes. The reqwest documentation says to enable the socks cargo feature and use a socks5:// URL, for example Proxy::http("socks5://192.168.1.1:9000"). Test your own login with the ipinfo.io call before relying on it.
How do I pass the proxy password in PowerShell?
Build a PSCredential from the login and a SecureString password and give it to -ProxyCredential. Microsoft documents that -ProxyCredential is valid only when -Proxy is also used.
Can I use these snippets with a fixed datacenter IP?
Yes. You only change the four values: use the host, port and protocol that My assets shows for that IP.
Read on 20 November 2026: the -Proxy and -ProxyCredential parameters, and the HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY variables read by PowerShell 7.
Proxy302 product facts and price list
Product observation · Confirmed on:
Product facts file of the site (values checked against the console, the backend and the price table): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, quantity limits, no free trial.
Ready to try it?
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.