This page will guide you on how to generate sticky and rotating proxies, Supported countries, other optional features, White labeling and FAQs regarding Packetstream APIs.
Countries are uppercase country codes. All supported countries are listed below.
const random_string = (length) => {
var result = "";
var characters = "abcdefghijklmnopqrstuvwxyz1234567890";
var charactersLength = characters.length;
for (var i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
};
function proxyGenerationSticky(
amount,
country,
username,
password,
) {
proxy = [];
for (var i = 0; i < amount; i++) {
proxy.push(
`pkt.x.proxiess.com:31112:${username}:${password}-country-${country}_session-${random_string(
7
)}\n`
);
}
return proxy.join("");
}
Session ( add this under sticky proxy generation )
The _session- key instructs our routing system to either create or resolve a unique session for the connection. The value assigned to this key must be a random alphanumeric string, precisely 8 characters in length. This ensures the uniqueness and integrity of the session.
Use this method to brand your proxies with your own domain/company name
To brand the proxies under your domain follow these steps:
Open the DNS configuration for your domain.
Create a CNAME Record pointing to the domain.
Whatever you enter in 'host' will decide the domain which points to our API IP.
Thus if your domain is API.com and you enter the host premium or whatever you want to call it pointing to the PacketStream domain, your proxies will be formatted premium.yourdomain.com:port:user:pass
An example on Godaddy is linked below:
API
Authentication
Record Type
Domain
Port
Packetstream
HTTP/HTTPS
CNAME
pkt.x.proxiess.com
31112
Packetstream EU
HTTP/HTTPS
CNAME
pkteu.x.proxiess.com
31113
Packetstream Asia
HTTP/HTTPS
CNAME
pktasia.x.proxiess.com
31114
Packetstream
SOCKS5
CNAME
sockspkt.x.proxiess.com
31115
Packetstream EU
SOCKS5
CNAME
sockspkteu.x.proxiess.com
31116
Packetstream Asia
SOCKS5
CNAME
sockspktasia.x.proxiess.com
31117
FAQ
What is Authorization?
This is a header value you provide with every request. We are using Bearer token so send in the header like this: "Authorization: Bearer <your api token>"
Im getting this error: {"message":"user_id cannot be null or undefined.","timestamp":1634146275996} how do I fix it?
Make sure you have this "Content-Type": "application/json" header present in your requests.
Headers
Please check on how to send requests with headers in whichever languages you are using.
POST Request:
{
"Authorization": "Bearer <your api token>",
"Content-Type": "application/json"
}