Plugging port-2115 lines into a ticket bot: the import file, line by line

2026-11-16 · Bazyl

After this post you can build the proxy file a ticket bot imports, check it before the bot ever sees it, and read any line in it at a glance. The thing that breaks most imports isn't the proxy. It is the file: a header row, Windows line endings, or two hundred lines that share forty session ids.

Every bot I've seen imports a plain text file, one proxy per line. So that's what we build.

One line, four fields

A residential line on port 2115 is four fields separated by colons:

eu-residential2.basilproxies.com:2115:basl_7k2m9x4z-cc-gb-sess-t01k4mz6-ttl-120:PASS

Field by field:

  • eu-residential2.basilproxies.com is the gateway. There are three, eu-, us- and ap-, all doors into one pool. Pick the one nearest the machine running the bot.
  • 2115 is the port, the only one. A line with a session token is sticky, a line without one rotates.
  • basl_7k2m9x4z-cc-gb-sess-t01k4mz6-ttl-120 is the username. The login is basl_ plus eight lowercase letters or digits, and every targeting token rides behind it as a -key-value pair.
  • PASS is the 20-character password. It carries nothing. Never put a token on it: the gateway reads that as a pair it has never seen and answers E01 invalid proxy login.

The username has hyphens and no colons, which is why the line always splits into exactly four parts. A bot that reports five fields is reading something that isn't in the line.

The tokens a ticket task uses

Three tokens do almost all the work in a ticket file. -cc- is the exit country as an ISO two-letter code: gb, us, de. -sess- is a session id you pick, 1 to 32 lowercase letters or digits, and it makes the line sticky. -ttl- is how many minutes that session should hold, 1 to 1440, and it needs a -sess- beside it.

Tokens go in any order, case doesn't matter, and each key appears once. An unknown key is an error, never silently dropped: a typo like -country-gb on a 2115 login comes back as a malformed username, one of E10 to E15, not a worldwide exit. I'd rather have that than a line that half works.

Pick the format the bot asks for

There are three common shapes, and the account API's /proxies endpoint writes all three:

  • host:port:user:pass, the default, and what most ticket bots import.
  • user:pass@host:port, for bots that think in URLs without the scheme.
  • url, the full http://user:pass@host:2115, for anything built on an HTTP library.

Don't convert by hand with find-and-replace. Ask for the right format and the file arrives right. The string formats post goes through which bots tend to want which.

Pull the file and check it in one script

The account API builds lines from credentials your account already holds: nothing is created and no data is spent. count goes up to 1,000 per call, and each sticky line comes back with its own fresh random session id and a 24-hour ttl (-ttl-1440). The key comes from Tools → API in the dashboard.

#!/usr/bin/env bash
# make-import.sh: pull sticky GB lines, write a clean import file, check it.
set -eu
COUNT=${1:-50}
OUT=proxies.txt

curl -s "https://api.basilproxies.com/api/v1/proxies?product=residential&country=gb&session=sticky&count=$COUNT" \
  -H "Authorization: Bearer $BASIL_API_KEY" \
  | jq -r '.proxies[]' | tr -d '\r' | sed '/^$/d' > "$OUT"

echo "lines: $(wc -l < "$OUT")"
echo "bad field count:"; awk -F: 'NF!=4' "$OUT"
echo "duplicate session ids:"; grep -o -- '-sess-[a-z0-9]*' "$OUT" | sort | uniq -d
echo "wrong port:"; awk -F: '$2!="2115"' "$OUT"

Three empty answers under the headings means the file is clean. The tr and sed lines are there because a file that passed through a Windows editor once carries a carriage return on every line, and some bots read that as part of the password.

The lines come back on the gateway matched to the account's country. If the bot runs on the other side of the world, swap the host with one sed and nothing else changes: same login, same exits, a shorter first hop.

Sticky lines for tasks, a rotating line for the monitor

A ticket task that holds a place wants a sticky line, one per task. A monitor that polls an event page wants a rotating line, which is the same login with no -sess- at all:

eu-residential2.basilproxies.com:2115:basl_7k2m9x4z-cc-gb:PASS

Keep them in two files. A bot that pulls monitor proxies from the task list ends up polling from a sticky address all morning. The sticky versus rotating post covers the split.

If the ttl matters, set it yourself. The API's 24 hours is the ceiling; the dashboard generator lets you pick, and writes up to 100,000 lines per generation. A task that runs two hours is fine on -ttl-120.

Before the import, test one line

Import is not the moment to discover a login that isn't ready. A brand-new login can answer 407 or E53 for its first minute or two while it reaches every gateway. That is not a wrong password.

LINE=$(head -1 proxies.txt)
IFS=: read -r H P U W <<< "$LINE"
curl -s -x "http://$U:$W@$H:$P" https://api.ipify.org; echo

An IP back means the file works. If the bot then refuses every line and that one test passed, the problem is the bot's import settings, usually the format choice.

When the balance runs out mid-session

A file of good lines stops working the moment the balance hits zero: E02 no data left on this login, on every line at once, and it keeps refusing until you top up. A bot that keeps retrying doesn't recover on its own. DM /alerts to the Basil bot and set a threshold above what a session uses, so you hear about it before the file goes dark.

What we answer for is the proxy being live and reachable from the country you asked for. What the ticketing site does with a request is its own business.

The bot developers page has the same /proxies call with the other parameters, ready to paste into your build script.

Common questions

Which format does a ticket bot's proxy import take?
Most take host:port:user:pass, one proxy per line, which is the dashboard's default. Some want user:pass@host:port or a full http:// URL. The account API's /proxies endpoint returns all three through its format parameter, so match the file to whatever the bot's import screen asks for.
Why does my bot split the line in the wrong place?
Usually a stray character, not the line itself. Windows line endings, a trailing space, a header row or a blank last line all turn into a broken fourth field. The username contains hyphens but never a colon, so a clean line always splits into exactly four parts.
Can two tasks share a line from the file?
They can, and then they share one IP, because the session id on the username decides the exit. Give every task its own line. A file of sticky lines with duplicate session ids is the most common reason a whole task group lands on a handful of addresses.
My login starts with res2_. Does this apply?
The fields are the same idea, but that login predates 27 October 2026 and keeps the legacy format on ports 4242 and 4243 with its tokens in a fixed order. The docs page has a legacy section with the exact strings.