Building a backconnect proxy

Residential proxy backconnect building

When using backconnect, make sure to always use the following endpoint:
Proxy server: gate.smartproxy.com
Proxy port: 7000

The cURL code will be shown in the examples below. You may try them out on your machine.


Authentication

All of the location and connection parameters would be specified in the proxy username when using backconnect instead of using our premade location endpoints.

📘

Please be aware that your username line will always start with 'user-' followed by your proxy username

❗️

With that in mind, make sure not to run the proxies from an IP address that has been whitelisted on our dashboard if you intend to use them in a browser or some other software.



An example of a rotating proxy that will return you an IP address from a random location:

curl -U user-SPusername:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Replace SPusername and SPpassword with your credentials and run the command in your Terminal or Command Prompt.

You will see the IP address that has been assigned to you for this particular request as well as the information on that IP address, including its location in the output.

321

Output example


If you encounter errors, do not hesitate to get in touch with our support team via Livechat.

The proxy is rotating in this example, so running another request will return a different IP address.


Country targeting

If IPs from a specific country are needed, then modify the username to include the country-xx parameter. Use two-letter Alpha-2 codes. There is a full list of them here.

Example of a rotating proxy that returns IPs from the US:

curl -U user-SPusername-country-us:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Rotating IPs from Italy:

curl -U user-SPusername-country-it:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

City targeting

Add a city-xxxx parameter to the username to specify a city within a country.

It's used in conjunction with the country parameter and is not standalone.

If the city name consists of multiple words, then use underscores.

Example of a rotating proxy that returns IPs from New York City:

curl -U user-SPusername-country-us-city-new_york:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Rotating IPs from Rome, Italy:

curl -U user-SPusername-country-it-city-rome:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

State targeting

Adding the state-us_xxxxx to your username will allow for state targeting. Only US states are supported for this at the moment.

An example of a rotating proxy that returns IPs from the state of New York:

curl -U user-SPusername-country-us-state-us_new_york:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Rotating IPs from California:

curl -U user-SPusername-country-us-state-us_california:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Continent targeting

Adding the continent parameter to your username will allow you to target IPs from a specific continent.

An example of a rotating proxy that returns IPs from Europe:

curl -U user-SPusername-continent-eu:SPpassword -x gate.smartproxy.com:7000 https://ip.smartproxy.com/json

📘

Continent codes

  • Asia – as
  • Africa – af
  • Europe – eu
  • North America – na
  • Oceania – oc
  • South America – sa

ASN targeting

Adding the asn parameter will allow you to target IPs from a specific carrier.

  • You must choose between city targeting and asn targeting, as they can’t be used simultaneously.
    • The same logic would apply to the continent and country parameters.
  • An example of a proxy withe the AT&T Mobility LLC asn number with a rotating session:
curl -U user-SPusername-asn-20057:SPpassword -x gate.smartproxy.com:7000 https://ip.smartproxy.com/json

📘

Carrier numbers

You can look up carrier numbers by searching online, for example here.


Sticky session

The examples above have been performed using a rotating session, so you'll get a new IP address with each request. Adding the session variable to the username will allow the IP address to persist for multiple requests.

An example of a Sticky session that returns IP addresses from the US:

curl -U user-SPusername-country-us-session-randomstring123:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Since this proxy is Sticky, the same IP address will be returned if you run the command again as there still is an active session with that IP address.

The default session duration is 10 minutes. The IP address will automatically rotate after that.

There must be a way to differentiate between each session that is assigned to the user since it's possible to have multiple active sticky sessions at once.

📘

Session values

The value – randomstring123 is used in the example above. Any alphanumeric text/string could be used depending on your preference. All of these would be viable:

session-random123
session-1
session-abcdef
session-2

Different session parameter values are used to differentiate between active sessions and behave just like the different sticky proxy ports with our country endpoints.

For example, if you run the commands above, you will see that the proxy IP persists even if a different proxy is used in between or at the same time.

The proxies with the session variable randomstring123 will return the same IP address as there is a sticky session.


In cases when it's necessary to change the country/city targeting or rotate the proxy IP sooner, the session parameter value must be changed as well (for example, from session-something to session-somethingelse). Otherwise, the IP address will not rotate.

curl -U user-SPusername-country-us-session-abcd:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json
curl -U user-SPusername-country-us-session-randomstring123:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

Session duration

Adding sessionduration-x to the username will allow the session to persist for up to 24 hours.

📘

Session length

Any integer between 1 and 1440 is accepted.

For example:
sessionduration-1
sessionduration-10
sessionduration-600

🚧

Premature rotation

The longer the session you have, the more chances there are that the IP will rotate before your specified time due to the residential device at the end going offline.


A sticky IP from Chicago that will persist for 90 minutes:

curl -U user-SPusername-country-us-city-chicago-session-example1-sessionduration-90:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

A sticky IP from Casablanca that will persist for one minute:

curl -U user-SPusername-country-ma-city-casablanca-session-example2-sessionduration-1:SPpassword -x gate.smartproxy.com:7000 ip.smartproxy.com/json

📘

Note

We cannot guarantee IP availability when using backconnect, especially if smaller countries or cities are targeted.