Residential proxies with ASN targeting

Add -asn- and the network number to the username, after the country, and every exit comes from that one ISP.

5 min readTested on via.proxies.vision · curl 8.7 · requests 2.32 · November 7, 2026
The username USER-country-ch-asn-3303 exits on Swisscom in Switzerland; USER-asn-3303 without a country is ignored and exits on any network in any country.What the network flag doesUSER-country-ch-asn-3303countryCHnetworkAS3303 Swisscom6 of 6USER-asn-3303no country, flag ignored · exits seen: ID, AR, US0 of 3via.proxies.vision · checked with ipinfo.io · November 7, 2026

In short

Write USER-country-ch-asn-3303 and the exit is a Swisscom home connection in Switzerland: 6 of 6 in our test, each a different IP. The country is required; -asn- on its own is ignored. Numbers only, no AS in front.

USER-country-ch-asn-3303465 = no match

The internet routes traffic between autonomous systems, and every ISP has at least one. Its number, the ASN, is what IP lookups show as org: AS7922 Comcast Cable Communications, AS3320 Deutsche Telekom AG. A residential IP always belongs to the ASN of the provider that connects that home.

Country and city targeting pick where an exit is. ASN targeting picks whose line it is. That matters when a site treats providers differently, when you test what customers of one carrier see, or when an account was always used from one ISP and should stay there.

Without a network filter you get whatever the country offers. In Switzerland 9 of 18 sticky sessions we opened on November 6 landed on Swisscom; the rest were Sunrise, Salt and netplus. With -asn-3303 every one was Swisscom.

UsernameNetworks seenSwisscom
USER-country-chSwisscom, Sunrise, Salt Mobile, netplus.ch9 of 18
USER-country-ch-asn-3303Swisscom (Bellinzona, Cernier, Thônex, Luzern, Zürich)6 of 6
Fig. 1 — 18 Swiss sessions without and 6 rotating requests with -asn-3303, checked with ipinfo.io, November 6 and 7, 2026.

The country comes first

The network flag only works inside a country. USER-asn-3303 without one gave us exits in Indonesia, Argentina and the US, none on Swisscom, and no error. A country and a network that don’t belong together are refused instead.

200USER-asn-3303flag ignored: ID, AR, US
465USER-country-us-asn-3303no Swisscom in the US
200USER-country-ch-asn-3303Swisscom, CH

Only the number

IP lookups print AS3303, but the username takes 3303. Both -asn-AS3303 and -asn-swisscom were refused with 403, the answer for a value the gateway can’t read.

403USER-country-ch-asn-AS3303AS prefix
403USER-country-ch-asn-swisscoma name
200USER-country-ch-asn-3303number only

A session keeps its exit

USER-country-us-asn-7922-session-job1-lifetime-10 on port 10000 answered three requests from the same Comcast IP. Reusing that session name with another country or ASN still returned the old exit, so pick a new name whenever the targeting changes. More on rotating and sticky sessions.

UsernamePortResult
USER-country-us-asn-79229000200 · US · AS7922 Comcast
USER-country-de-asn-33209000200 · DE · AS3320 Deutsche Telekom
USER-country-ch-asn-673010000200 · CH · AS6730 Sunrise
USER-country-gb-asn-285611000 (SOCKS5)200 · GB · AS2856 British Telecommunications
USER-country-de-city-berlin-asn-33209000200 · 2 of 3 in Berlin, 1 in Burg bei Magdeburg
USER-country-ch-asn-999999999000465 · no exit

November 6 and 7, 2026. City plus network narrows the pool a lot, and the city is not always where the lookup places the IP.

Which networks a country has, and how often we saw them, is on each country page: for example Comcast, Deutsche Telekom, Swisscom and BT. The AS number is in each page’s address.

A setup that works

Ran unchanged against our gateway on November 7, 2026. PROXY_USER and PROXY_PASS come from the environment.

asn_targeting.py
import os
import re

import requests  # pip install requests

USER, PASS = os.environ["PROXY_USER"], os.environ["PROXY_PASS"]


def proxy(country, asn, session=None, minutes=10):
    name = f"{USER}-country-{country}-asn-{asn}"  # the ASN only counts together with a country
    port = 9000
    if session:  # sticky: same IP for `minutes`, on the sticky port
        name += f"-session-{session}-lifetime-{minutes}"
        port = 10000
    url = f"http://{name}:{PASS}@via.proxies.vision:{port}"
    return {"http": url, "https": url}


for country, asn in [("us", 7922), ("de", 3320), ("ch", 3303), ("us", 3303)]:
    try:
        info = requests.get("https://ipinfo.io/json", proxies=proxy(country, asn), timeout=30).json()
    except requests.exceptions.ProxyError as e:
        code = re.search(r"failed: (\d{3})", str(e))  # 465: no exit on that network in that country
        print(country, asn, "proxy refused:", code.group(1) if code else e)
        continue
    print(country, asn, "->", info["country"], info["org"])
txt
us 7922 -> US AS7922 Comcast Cable Communications, LLC
de 3320 -> DE AS3320 Deutsche Telekom AG
ch 3303 -> CH AS3303 Swisscom (Switzerland) Ltd
us 3303 proxy refused: 465

On the command line

curl -x http://via.proxies.vision:9000 -U "$PROXY_USER-country-de-asn-3320:$PROXY_PASS" https://ipinfo.io/json prints the exit and its org. A 465 shows as CONNECT tunnel failed, response 465; what curl’s tunnel errors mean.

No code needed: the generator in the dashboard and the public proxy list generator have a Network (ASN) field that writes the flag for you.

What is ASN targeting for residential proxies?
Every ISP announces its addresses under an autonomous system number (ASN): Comcast is AS7922, Deutsche Telekom AS3320, Swisscom AS3303. ASN targeting asks the proxy for an exit whose IP belongs to that number, so the site you visit sees a home connection from that one provider.
Why does -asn- give me IPs from the wrong country or ISP?
On our gateway the network flag only counts together with a country. USER-asn-3303 alone was ignored in our test and exited in Indonesia, Argentina and the US. Write the country first: USER-country-ch-asn-3303.
What does 465 mean with ASN targeting?
No exit matches the filters right now. It happens when the country and the network don't belong together (USER-country-us-asn-3303 asks for Swisscom in the US) or the number doesn't exist. Check the ASN for that country, or leave the city filter out.
Can I write AS3303 instead of 3303?
No. The gateway wants the number only; -asn-AS3303 and -asn-swisscom were both refused with 403. Our generators strip the AS for you.
How do I keep the same ISP and the same IP?
Add a sticky session on port 10000: USER-country-us-asn-7922-session-job1-lifetime-10 kept one Comcast IP for every request in our test. Use a new session name when you change the country or the ASN; an existing session keeps its old exit.

Residential proxies, pay per GB

HTTP and SOCKS5. Country, city and sticky sessions in the username. No subscription.