- Host
- gw.prokso.com
- Port
- 823 HTTP · 824 SOCKS5 — new IP per request · 10000–20000 sticky session, HTTP(S) and SOCKS5
- Username and password
- in your dashboard, on the plan page
Your dashboard generates ready-made lines in the format you need: choose the country, IP type and protocol.
- Host gw.prokso.com, ports 823 (HTTP), 824 (SOCKS5), 10000–20000 (sticky sessions, HTTP or SOCKS5)
- The username and password are in your dashboard on the plan page
- Check the IP in the response of the proxied request itself: the My IP page in a browser does not test your script
A step-by-step guide to connecting Prokso proxies in Go. It takes a few minutes.
Step 1. Get the proxy details from your dashboard
Open your plan and copy the host gw.prokso.com, port, username and password. Port 823 is HTTP and 824 is SOCKS5 (both give a new IP for every request); ports 10000–20000 keep one IP (sticky session) for up to 120 minutes and work as both HTTP and SOCKS5 (each port is a separate address). Set the country in the username: username__cr.ua.
Step 2. Install nothing
Everything you need is in the standard library: the net/http and net/url packages. You don't need third-party modules for either HTTP or SOCKS5.
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"time"
)
func main() {
proxyURL, err := url.Parse("http://USERNAME:PASSWORD@gw.prokso.com:823")
if err != nil {
panic(err)
}
client := &http.Client{
Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
Timeout: 30 * time.Second,
}
resp, err := client.Get("https://api.ipify.org?format=json")
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}Step 3. Set the proxy on the Transport
Parse the proxy URL with the username and password using url.Parse and pass it to the Proxy field via http.ProxyURL. Go adds the authorization header itself, both for plain requests and for https websites through a tunnel.
Step 4. SOCKS5 with the same URL
Go picks the proxy type from the URL scheme. Change http:// to socks5:// and the port to 824, and the rest of the code stays the same. The username and password are still taken from the URL.
Step 5. One client for the whole program
Create the http.Client once and use it from all goroutines: it is safe for concurrent use and reuses connections to the proxy. For a series of requests from one IP, use a sticky port from 10000-20000.
Step 6. If the connection fails
Check the host gw.prokso.com, the port and the scheme: HTTP on 823, SOCKS5 on 824, either one on ports 10000-20000. A 407 error means a wrong username or password, or the plan has run out of traffic: check the balance on the plan page in your dashboard. A timeout most often means a typo in the port or a client expecting a different protocol. If you use the IP whitelist, make sure the external address of the exact machine running the code is on the list.
Step 7. Check the output
Run the example: the program calls https://api.ipify.org and prints the IP the website sees. It should be the proxy's address, not yours. A 407 error means a wrong username or password, or the plan has run out of traffic. The My IP page in your browser won't help here: the browser goes direct.
FAQ
Will Go pick up the proxy from environment variables?
Only if the Transport uses <code>http.ProxyFromEnvironment</code>, as the standard <code>http.DefaultTransport</code> does. Then <code>HTTPS_PROXY</code> and <code>HTTP_PROXY</code> apply. In the example the proxy is set explicitly, so the variables don't affect it.
Why does a request hang with no response?
Set a <code>Timeout</code> on the client as in the example: without it Go waits forever. If the timeout fires straight away, check the port and scheme: HTTP on 823, SOCKS5 on 824.
Which port should I use?
Port 823 (HTTP) or 824 (SOCKS5) gives a new IP on every request, which suits data collection. A port from 10000-20000 keeps one IP for up to 120 minutes, for sessions where you sign in to an account. A plan allows up to 1,000 concurrent connections.
How do I choose a country?
The country is part of the proxy username. Generate a line for the country you need in the dashboard and use its username in the code; the rest of the address stays the same.
What if some requests fail?
When collecting data, some addresses can be slow or unavailable. Add a few retries with a pause to your code: on port 823 or 824 every retry goes out from a new address.