Skip to main content
ProxyHive Help Centre

Connecting with a username and password

Updated 2 min read

Every proxy on your account has its own username and password, unless it is set to the IP allowlist, and they are not your dashboard login. Find them on the proxy's page, copy them exactly, and the proxy checks them on every connection.

Find the values

  1. In the dashboard side menu, open Proxies and pick the line: Residential, ISP or Datacenter.
  2. Click the proxy. The Connection card shows the Gateway (residential) or Endpoint (ISP and datacenter), the Username and the Password. Use the copy buttons rather than retyping.
  3. Read the Protocol line on the same card. It names the protocol and the port to use with it.

Use them

HTTP proxy. Most clients take the credentials from the proxy URL and send them in a Proxy-Authorization header:

python
import requests
from urllib.parse import quote

proxy = f"http://USERNAME:{quote('PASSWORD', safe='')}@HOST:PORT"
print(requests.get("https://api.ipify.org", proxies={"http": proxy, "https": proxy}, timeout=15).text)

quote(..., safe='') matters if the password holds @, :, /, # or %: left raw, they split the URL in the wrong place. By hand, @ becomes %40 and : becomes %3A. curl avoids the problem by taking the credentials separately:

bash
curl -x http://HOST:PORT -U "USERNAME:PASSWORD" https://api.ipify.org

SOCKS5 proxy. If the Protocol line says SOCKS5, the credentials travel in the SOCKS5 handshake. Use socks5h:// so the proxy also resolves the target's host name:

bash
curl -x "socks5h://USERNAME:PASSWORD@HOST:PORT" https://api.ipify.org

The proxy page's Integration examples card has the same request ready for cURL, Python, Node.js, PHP, Go, Java and C#.

Getting a new password

Where the Connection card offers Generate a new password, it replaces the password at once; the username stays the same. Anything still using the old one stops connecting, so update your clients straight after.

When you get a 407

A 407 Proxy Authentication Required means the proxy did not get credentials it accepts. Check, in this order:

  1. A space or line break came along with the paste.
  2. You copied from a different proxy than the one whose host you connect to.
  3. A browser or desktop app is replaying old credentials from a saved prompt.

If Authentication on the Connection card reads IP allowlist, the proxy has no username or password: connect from a listed address, or switch back with Change. See Using an IP allowlist instead of credentials.

The full walk-through is in 407 or 403: find out who answered. Still stuck? Email support@proxyhive.io with the command you ran and the password replaced by REDACTED.

Still stuck?

Our support team can look into your case. You can also write to support@proxyhive.io.

Chat with support