Skip to content

Commit 51eb46d

Browse files
More proxy configuration examples (#75)
* More proxy examples * Fix --------- Co-authored-by: Mason Williams <43387599+masnwilliams@users.noreply.github.com>
1 parent e556f95 commit 51eb46d

File tree

2 files changed

+115
-9
lines changed

2 files changed

+115
-9
lines changed

proxies/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ When no longer needed, delete the proxy configuration:
8484
<DeleteProxySnippet />
8585

8686
<Info>
87-
Deleting a proxy does not affect existing browser sessions that are currently using it. The configuration is only removed from your organization so it can't be used in future browser sessions.
87+
Deleting a proxy immediately reconfigures associated browsers to route directly to the internet.
8888
</Info>
8989

9090
## Limitations

proxies/residential.mdx

Lines changed: 114 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Residential proxies route traffic through real residential IP addresses. They su
66

77
## Configuration
88

9-
Residential proxies support multiple targeting parameters:
9+
Create a residential proxy with a target country:
1010

1111
<CodeGroup>
1212

@@ -16,10 +16,9 @@ const kernel = new Kernel();
1616

1717
const proxy = await kernel.proxies.create({
1818
type: 'residential',
19-
name: 'my-la-residential',
19+
name: 'my-us-residential',
2020
config: {
21-
country: 'US',
22-
city: 'los_angeles'
21+
country: 'US'
2322
}
2423
});
2524

@@ -34,10 +33,9 @@ client = kernel.Kernel()
3433

3534
proxy = client.proxies.create(
3635
type='residential',
37-
name='my-la-residential',
36+
name='my-us-residential',
3837
config={
39-
'country': 'US',
40-
'city': 'los_angeles'
38+
'country': 'US'
4139
}
4240
)
4341

@@ -54,4 +52,112 @@ browser = client.browsers.create(
5452
- **`state`** - Two-letter state code. Only supported for US.
5553
- **`city`** - City name (lowercase, no spaces, e.g., `sanfrancisco`, `newyork`).
5654
- **`zip`** - US ZIP code (5 digits). Conflicts with city and state.
57-
- **`asn`** - Autonomous System Number. Conflicts with city and state.
55+
- **`asn`** - Autonomous System Number. Conflicts with city and state.
56+
57+
## Advanced Targeting Examples
58+
59+
Kernel recommends using the least-specific targeting configuration that works for your use case. The more specific a configuration, the less available IPs there are, increasing the chance of a slow connection or no available connection (`no_peer` connection error).
60+
61+
### Target by City
62+
63+
Route traffic through a specific city:
64+
65+
<CodeGroup>
66+
67+
```typescript Typescript/Javascript
68+
const proxy = await kernel.proxies.create({
69+
type: 'residential',
70+
name: 'la-residential',
71+
config: {
72+
country: 'US',
73+
state: 'CA',
74+
city: 'los_angeles'
75+
}
76+
});
77+
```
78+
79+
```Python Python
80+
proxy = client.proxies.create(
81+
type='residential',
82+
name='la-residential',
83+
config={
84+
'country': 'US',
85+
'state': 'CA',
86+
'city': 'los_angeles'
87+
}
88+
)
89+
```
90+
91+
</CodeGroup>
92+
93+
<Note>
94+
If the city name is not matched, the API will return the best 10 city names from the state to help you find the correct city identifier.
95+
</Note>
96+
97+
### Target by State
98+
99+
Route traffic through a specific state:
100+
101+
<CodeGroup>
102+
103+
```typescript Typescript/Javascript
104+
const proxy = await kernel.proxies.create({
105+
type: 'residential',
106+
name: 'ny-residential',
107+
config: {
108+
country: 'US',
109+
state: 'NY'
110+
}
111+
});
112+
```
113+
114+
```Python Python
115+
proxy = client.proxies.create(
116+
type='residential',
117+
name='ny-residential',
118+
config={
119+
'country': 'US',
120+
'state': 'NY'
121+
}
122+
)
123+
```
124+
125+
</CodeGroup>
126+
127+
<Note>
128+
If the state name is not matched, the API will return the most-available 10 states.
129+
</Note>
130+
131+
### Target by ASN
132+
133+
Route traffic through a specific Autonomous System Number (ISP):
134+
135+
<CodeGroup>
136+
137+
```typescript Typescript/Javascript
138+
const proxy = await kernel.proxies.create({
139+
type: 'residential',
140+
name: 'comcast-residential',
141+
config: {
142+
country: 'US',
143+
asn: 'AS7922'
144+
}
145+
});
146+
```
147+
148+
```Python Python
149+
proxy = client.proxies.create(
150+
type='residential',
151+
name='comcast-residential',
152+
config={
153+
'country': 'US',
154+
'asn': 'AS7922'
155+
}
156+
)
157+
```
158+
159+
</CodeGroup>
160+
161+
<Note>
162+
If the ASN is not matched, the API will return the most-available 10 examples.
163+
</Note>

0 commit comments

Comments
 (0)