How to Create a New Sticky Session

Sticky sessions let you keep the same IP address longer, which is useful for tasks that need a stable connection, like managing social media accounts or web scraping. Knowing how to use sticky sessions can improve your proxy experience by making it more efficient and reliable.

There are two methods you can use:

  • Targeting the Sticky Ports
  • Custom sessions via proxy username config

Here is a table for the Protocols used and the corresponding number of ports:

ProtocolNumber of Ports
HTTPS10000-10900
SOCKS512000-12010

Method 1: Targeting the Sticky Ports

Step 1: Log In to Geonode Dashboard

Access the Geonode Dashboard using your registered account credentials.

Step 1a: HTTP/HTTPS Proxy Configuration

Under the "Proxy setup" tab, locate the "Proxy configuration" feature. Select "Sticky" option and choose the "HTTP/HTTPS" protocol. The default "Rotating interval" is in minutes.

Select the country and port number. Click the "Add" button.

Step 1b: HTTP/HTTPS Implementation

In this example, we will have "France" as the "country" and the port number is 10009:


Implementation

We will do a cURL request targeting port 10009*.* Fill in the credentials from the service you purchased:

curl -x <username>:<password>@<service-name>.geonode.com:<10009> http://ip-api.com/json
Expected Response

{
  "status":"success",
  "country":"France",
  "countryCode":"FR",
  "region":"PAC",
  "regionName":"Provence-Alpes-Côte d'Azur",
  "city":"Nice",
  "zip":"06000",
  "lat":43.7045,
  "lon":7.2597,
  "timezone":"Europe/Paris",
  "isp":"Societe Francaise Du Radiotelephone - SFR SA",
  "org":"",
  "as":"AS15557 Societe Francaise Du Radiotelephone - SFR SA",
  "query":"85.68.235.69"
}


Step 1c: HTTP/HTTPS Verification

Go to the "Statistics" tab and locate the "Sticky Sessions" table. You can see here the sticky sessions with specific countries and their corresponding duration and rotating intervals.

Step 1d: SOCKS5 Proxy Configuration

Go back to the "Proxy setup" tab, locate the "Proxy configuration" feature. Select "Sticky" option and choose the "SOCKS5" protocol. The default "Rotating interval" is in minutes.

Select the country and port number. Click the "Add" button.

SOCKS5

Step 1e: SOCKS5 Implementation

In this example, we will have "France" as the "country" and the port number is 12009:


Implementation

Fill in the credentials from the service you purchased:

curl -x socks5://geonode_<username>:<password>@<service-name>.geonode.com:<12009> http://ip-api.com
Expected Response

{
  "status"       : "success",
  "continent"    : "Europe",
  "continentCode": "EU",
  "country"      : "France",
  "countryCode"  : "FR",
  "region"       : "IDF",
  "regionName"   : "Île-de-France",
  "city"         : "Paris",
  "district"     : "",
  "zip"          : "93200",
  "lat"          : 48.9275,
  "lon"          : 2.3623,
  "timezone"     : "Europe/Paris",
  "offset"       : 7200,
  "currency"     : "EUR",
  "isp"          : "Getechbrothers, MB",
  "org"          : "Codefr2",
  "as"           : "AS202044 Getechbrothers, MB",
  "asname"       : "Getechbrothers-Internet",
  "mobile"       : false,
  "proxy"        : false,
  "hosting"      : false,
  "query"        : "216.173.72.221"
}


Step 1f: SOCKS5 Verification

Go to the "Statistics" tab and locate the "Sticky Sessions" table. You can see here the sticky sessions with specific countries and their corresponding duration and rotating interval.


Method 2: Custom Sessions via Proxy Username Config

Request
GET
curl -x <username>-country-<country-code>-session-<session-id>-lifetime-<lifetime>:<password>@<service-name>.geonode.com:<port> http://ip-api.com/json

Parameters

username string

Your API username (Required)


country-code string

The country code for geo-targeting.


session-id string

Custom session ID. The string must start with one of the following characters:

- An uppercase letter (A-Z)

- A lowercase letter (a-z)

- A digit (0-9)

- An underscore (_)

The character can be repeated, but the total length of the string must be between 1 and 25 characters only. The string must end immediately after these 1 to 25 characters; there should be no other characters before or after. This format ensures the string is composed solely of 1 to 25 alphanumeric characters or underscores.

E.g., randomID001


lifetime e.g., 15

Duration of the session in minutes.


password string

Your API password (Required)


service-name e.g., residential-premium

The name of the service that you purchase.


port integer

The target port number. Use 9***'s for rotating and 10***'s for sticky proxies.


Implementation

Fill in the credentials from the service you purchased:

curl -x <username>-country-us-session-randomID001-lifetime-15:<password>@<service-name>.geonode.com:10009 http://ip-api.com
Expected Response

{
  "status"       : "success",
  "continent"    : "North America",
  "continentCode": "NA",
  "country"      : "United States",
  "countryCode"  : "US",
  "region"       : "FL",
  "regionName"   : "Florida",
  "city"         : "Palmetto",
  "district"     : "",
  "zip"          : "34221",
  "lat"          : 27.543,
  "lon"          : -82.5602,
  "timezone"     : "America/New_York",
  "offset"       : -14400,
  "currency"     : "USD",
  "isp"          : "Frontier Communications Corporation",
  "org"          : "Frontier Communications Solutions",
  "as"           : "AS5650 Frontier Communications of America, Inc.",
  "asname"       : "FRONTIER-FRTR",
  "mobile"       : false,
  "proxy"        : false,
  "hosting"      : false,
  "query"        : "47.200.220.17"
}


Let's have an actual implementation and do a cURL request targeting port "10009", using "US" as the country, "randomID001" as the session ID and "15" as the lifetime value.

In the Geonode dashboard, go to the "Statistics" tab and locate the "Sticky Sessions" table. This is custom session verification, by adding parameters like lifetime to the cURL request, you can see the results reflected on the dashboard.

Conclusion

Our proxy service lets you create and control sticky sessions easily. Adding custom commands allows you to hold multiple sticky sessions on the same port. This gives you more flexibility and control over your connections.