PacketStream integration
Using PacketStream residential proxies with cURL
Copy a cURL command for PacketStream's HTTPS or SOCKS5 residential proxy, then verify the exit, country, and sticky session.
Use cURL to confirm your PacketStream credentials, country selection, and exit IP before you add proxy settings to an application or deployment.
Configure
Set your PacketStream username and dashboard auth key, then use the recommended HTTPS endpoint on port 31111:
export PACKETSTREAM_USER='your_username'
export PACKETSTREAM_AUTH_KEY='your_auth_key'
set -o pipefail
curl --silent --show-error --fail-with-body \
--proxy 'https://proxy.packetstream.io:31111' \
--proxy-user "${PACKETSTREAM_USER}:${PACKETSTREAM_AUTH_KEY}" \
'https://ipinfo.io' \
| jq '{ip, hostname, city, region, country, loc, org, postal, timezone}'
This canonical inline check expands the credentials in cURL’s process arguments. Use it on a single-user machine. On a shared host, put proxy-user in a mode-0600 cURL config instead.
If you need SOCKS5, change the endpoint and port:
curl --silent --show-error --fail-with-body \
--proxy 'socks5h://proxy.packetstream.io:31113' \
--proxy-user "${PACKETSTREAM_USER}:${PACKETSTREAM_AUTH_KEY}" \
'https://ipinfo.io'
Verify your exit
The ipinfo.io response shows the observed ip, country, and network details. Use --connect-timeout and --max-time when this check runs unattended.
Country targeting and sticky sessions
Append the modifiers to the password passed through --proxy-user. This example requests a United States exit and keeps one exit for the related catalog42 workflow:
ROUTED_AUTH_KEY="${PACKETSTREAM_AUTH_KEY}_country-US_session-catalog42"
set -o pipefail
curl --silent --show-error --fail-with-body \
--proxy 'https://proxy.packetstream.io:31111' \
--proxy-user "${PACKETSTREAM_USER}:${ROUTED_AUTH_KEY}" \
'https://ipinfo.io' \
| jq '{ip, country, region, city, org}'
Use uppercase ISO two-letter country codes. Use a non-sensitive label after _session-.
Troubleshooting
- Keep
https://paired with port31111andsocks5h://paired with port31113. - Quote the
--proxy-uservalue so the shell passes the username and full auth key as one argument. - Do not treat a repeated IP in a small sample as a rotation failure. cURL can reuse a connection within one process.
See proxy troubleshooting for authentication, TLS, targeting, and timeout checks.