diff --git a/docs.json b/docs.json index 763e3d5..7e2e425 100644 --- a/docs.json +++ b/docs.json @@ -136,6 +136,7 @@ "proxies/overview", "proxies/custom", "proxies/residential", + "proxies/mobile", "proxies/isp", "proxies/datacenter" ] diff --git a/proxies/mobile.mdx b/proxies/mobile.mdx new file mode 100644 index 0000000..ed2adc7 --- /dev/null +++ b/proxies/mobile.mdx @@ -0,0 +1,162 @@ +--- +title: "Mobile Proxies" +--- + +Mobile proxies route traffic through mobile carrier networks. Only recommended in advanced stealth use cases. + + +Mobile carrier IPs often route through shared regional gateways. Country targeting is the most reliable option; city and US state targeting are best-effort and may not match every third-party geolocation database. + + +## Configuration + +Create a mobile proxy with a target country: + + +```typescript Typescript/Javascript +import Kernel from '@onkernel/sdk'; + +const kernel = new Kernel(); + +const proxy = await kernel.proxies.create({ + type: 'mobile', + name: 'my-us-mobile', + config: { + country: 'US' + } +}); + +const browser = await kernel.browsers.create({ + proxy_id: proxy.id, +}); +``` + +```python Python +from kernel import Kernel + +kernel = Kernel() + +proxy = kernel.proxies.create( + type='mobile', + name='my-us-mobile', + config={ + 'country': 'US' + } +) + +browser = kernel.browsers.create(proxy_id=proxy.id) +``` + + +## Configuration parameters + +- **`country`** - ISO 3166 country code. Must be provided when providing other targeting options. +- **`state`** - US-only two-letter state code. Best-effort for mobile proxies. +- **`city`** - Provider city alias, such as `brooklyn` or `chicago`. Best-effort for mobile proxies. +- **`bypass_hosts`** (optional) - Array of hostnames that bypass the proxy and connect directly (max 100 entries) + +## Advanced targeting examples + +### Target by city + +Route traffic through a specific city: + + + +```typescript Typescript/Javascript +const proxy = await kernel.proxies.create({ + type: 'mobile', + name: 'brooklyn-mobile', + config: { + country: 'US', + state: 'NY', + city: 'brooklyn' + } +}); +``` + +```Python Python +proxy = kernel.proxies.create( + type='mobile', + name='brooklyn-mobile', + config={ + 'country': 'US', + 'state': 'NY', + 'city': 'brooklyn' + } +) +``` + + + + +If the city alias is not matched, the API returns examples from the target state to help you find the correct value. + + +### Target by state + +Route traffic through a US state: + + + +```typescript Typescript/Javascript +const proxy = await kernel.proxies.create({ + type: 'mobile', + name: 'ny-mobile', + config: { + country: 'US', + state: 'NY' + } +}); +``` + +```Python Python +proxy = kernel.proxies.create( + type='mobile', + name='ny-mobile', + config={ + 'country': 'US', + 'state': 'NY' + } +) +``` + + + +## Bypass hosts + +Configure specific hostnames to bypass the proxy: + + +```typescript Typescript/Javascript +const proxy = await kernel.proxies.create({ + type: 'mobile', + name: 'mobile-with-bypass', + config: { + country: 'US', + }, + bypass_hosts: [ + 'localhost', + 'metadata.google.internal', + '*.internal.company.com', + ], +}); +``` + +```python Python +proxy = kernel.proxies.create( + type='mobile', + name='mobile-with-bypass', + config={ + 'country': 'US', + }, + bypass_hosts=[ + 'localhost', + 'metadata.google.internal', + '*.internal.company.com', + ] +) +``` + + +See the [overview](/proxies/overview#bypass-hosts) for full bypass host rules and examples. diff --git a/proxies/overview.mdx b/proxies/overview.mdx index 52a4dee..48e6c28 100644 --- a/proxies/overview.mdx +++ b/proxies/overview.mdx @@ -6,19 +6,20 @@ Kernel proxies enable you to route browser traffic through different types of pr ## Proxy Types -Kernel supports four types of proxies: +Kernel supports five types of proxies: 1. [**Datacenter**](/proxies/datacenter) - Traffic routed through commercial data centers 2. [**ISP**](/proxies/isp) - Traffic routed through data centers, using residential IP addresses leased from from internet service providers 3. [**Residential**](/proxies/residential) - Traffic routed through real residential IP addresses -4. [**Custom**](/proxies/custom) - Your own proxy servers +4. [**Mobile**](/proxies/mobile) - Traffic routed through mobile carrier networks +5. [**Custom**](/proxies/custom) - Your own proxy servers -Datacenter has the fastest speed, while residential is least detectable. ISP is a balance between the two options, with less-flexible geotargeting. Kernel recommends to use the first option in the list that works for your use case. +Datacenter has the fastest speed, while residential and mobile are least detectable. ISP is a balance between the options, with less-flexible geotargeting. Kernel recommends using the first option in the list that works for your use case. Datacenter and ISP proxies provide a **stable exit IP within a single browser session** — the IP does not rotate mid-session. Across separate sessions, however, Kernel does not guarantee the same exit IP. If you need a truly static IP that persists across every session (for example, an IP allowlist or a [managed auth](/auth/overview) connection whose health checks must egress from a single IP), use a [custom (BYO) proxy](/proxies/custom) pointed at infrastructure you control. -Residential proxies use **rotating exit IPs** that may change per connection — see [Residential Proxies](/proxies/residential#ip-rotation-behavior) for details. +Residential and mobile proxies use **rotating exit IPs** that may change per connection — see [Residential Proxies](/proxies/residential#ip-rotation-behavior) and [Mobile Proxies](/proxies/mobile) for details. ## Create a proxy diff --git a/reference/cli/browsers.mdx b/reference/cli/browsers.mdx index 0b7586e..8b5b378 100644 --- a/reference/cli/browsers.mdx +++ b/reference/cli/browsers.mdx @@ -394,11 +394,10 @@ Create a new proxy configuration. | `--protocol ` | Protocol to use (`http` or `https`; default: `https`). | | `--country ` | ISO 3166 country code or `EU`. | | `--city ` | City (residential, mobile; requires `--country`). | -| `--state ` | State/region code (residential, mobile). | -| `--zip ` | ZIP/postal code (residential, mobile). | -| `--asn ` | Autonomous system number (residential, mobile). | +| `--state ` | State/region code (residential; US-only for mobile). | +| `--zip ` | ZIP/postal code (residential). | +| `--asn ` | Autonomous system number (residential). | | `--os ` | Operating system (`windows`, `macos`, `android`; residential). | -| `--carrier ` | Mobile carrier (mobile). | | `--host ` | Proxy host (custom; required). | | `--port ` | Proxy port (custom; required). | | `--username ` | Proxy username (custom). |