Skip to main content

Proxy

Lantfly has one rotating proxy endpoint in front of several proxy groups (for example datacenter or residential IPs). Actors get it automatically; you can use it from your own code too. Traffic is billed per GB at the price of the group it went through. Open Storage & Proxy → Proxy in the Console.

Connection details​

The Connection card shows:

FieldMeaning
Hostname and PortThe proxy endpoint
UsernameBuilt from the options below
PasswordYour account's proxy password (Show / Hide)

Use Build a connection URL to pick a Group, a Country (two letters, such as VN or US) and a Sticky session, then copy the URL:

http://groups-RESIDENTIAL,country-VN,session-abc123:YOUR_PROXY_PASSWORD@HOSTNAME:PORT

The same details come from the API:

Get proxy details
curl -s "https://lantfly.com/api/v3/proxy" \
-H "Authorization: Bearer $LANTFLY_TOKEN"

The answer has hostname, port, password, a sample connection_url, the groups you can use (with price_per_gb_usd) and usage_30d.

Username options​

The username is a comma-separated list of parts:

PartMeaning
groups-GROUPThe group to use, such as groups-RESIDENTIAL. Join several with + (groups-RESIDENTIAL+DATACENTER). groups-auto lets Lantfly pick any group.
country-CCExit IPs from this country only: exactly two letters, such as country-VN.
session-IDA sticky session: requests with the same ID keep the same exit IP while it stays healthy. Pick any ID of your own.
ttl-MINUTESHow long a sticky session is kept, 1 to 1,440 minutes (10 by default).
run-RUN_IDAttribute the traffic to one of your runs, so it shows on that run's usage. Actors set this for you.

Without session-, each connection may get a different IP.

Use the proxy with curl
curl -x "http://groups-RESIDENTIAL,country-VN,session-s1:$LANTFLY_PROXY_PASSWORD@HOSTNAME:PORT" \
https://api.ipify.org?format=json

Groups and countries​

The Groups table lists the groups your account can use, what each is for and its Price / GB. A country is available only where the group has exit IPs in it; if none match, the request fails with no-upstream-for-country.

Proxy in actors​

Actors that run on Lantfly get the proxy hostname, port and password in their environment and use them through the SDK. In an actor's input, the Proxy field usually lets you pick the group and country. Traffic of a run is shown on the run's Usage tab.

Traffic and billing​

Traffic, last 30 days shows bytes and requests per group. Proxy traffic is billed per GB at the group's price, in addition to compute. See Billing.

Rotate the password​

Click Rotate password (or POST /api/v3/proxy/rotate-password) to get a new password. Code that uses the old password stops working; running actors pick up the new one on their next run.

In an organization, only members whose role can view the proxy see the password.

Errors​

When the proxy refuses or cannot complete a request, the answer carries an X-Lantfly-Proxy-Error header:

ValueMeaning
wrong-passwordThe password is wrong or was rotated
bad-usernameThe username could not be read; check the parts above
no-upstream-for-countryNo exit IP in that country for the chosen group
no-upstream-in-group, no-healthy-upstreamThe group has no working exit right now; try again or pick another group
forbidden-targetThe destination is not allowed (private networks, or ports other than 80 and 443 on direct groups)
target-failed, target-unreachableThe destination site did not answer
upstream-failedThe exit failed; the proxy retries once on another exit before giving up

Idle tunnels are closed after 5 minutes without traffic, and a tunnel lasts at most 2 hours.