インテグレーション
HTTPまたはSOCKS5を話すクライアントであれば、どれでもShifterゲートウェイと連携できます。以下は、多くのお客様が利用しているツール向けのコピー&ペースト用設定です。
コマンドライン
Section titled “コマンドライン”curl -x customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443 \ https://ipinfo.io/jsonhttps_proxy=customer-USERNAME-country-us-sid-9f3a2b7c-ttl-600:PASSWORD@p.shifter.io:443 \ wget -qO- https://ipinfo.io/jsonScrapy
Section titled “Scrapy”リクエストごとにプロキシURLをローテーションし、request.meta経由でスパイダーが国を上書きできるようにするミドルウェアです。
DOWNLOADER_MIDDLEWARES = { "scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware": 110, "your_project.middlewares.ShifterProxyMiddleware": 100,}
# middlewares.pyimport os
class ShifterProxyMiddleware: def process_request(self, request, spider): username = os.environ["SHIFTER_USERNAME"] password = os.environ["SHIFTER_PASSWORD"] country = request.meta.get("shifter_country", "us") request.meta["proxy"] = ( f"http://{username}-country-{country}:{password}@p.shifter.io:443" )request.meta["shifter_country"] = "de" でリクエストごとに上書きできます。
Puppeteer
Section titled “Puppeteer”import puppeteer from 'puppeteer';
const browser = await puppeteer.launch({ args: ['--proxy-server=http://p.shifter.io:443'],});const page = await browser.newPage();
await page.authenticate({ username: 'customer-USERNAME-country-us-sid-s1-ttl-600-sid-9f3a2b7c-ttl-600', password: 'PASSWORD',});
await page.goto('https://ipinfo.io/json');console.log(await page.content());await browser.close();Playwright
Section titled “Playwright”import { chromium } from 'playwright';
const browser = await chromium.launch({ proxy: { server: 'http://p.shifter.io:443', username: 'customer-USERNAME-country-us-sid-s1-ttl-600-sid-9f3a2b7c-ttl-600', password: 'PASSWORD', },});const page = await browser.newPage();await page.goto('https://ipinfo.io/json');SwitchyOmega
Section titled “SwitchyOmega”- Options → New Profile → Proxy Profile を開きます。
- Protocol:
HTTP、Server:p.shifter.io、Port:443。 - Username:
customer-USERNAME-country-us。Password:PASSWORD。 - 変更を適用し、新しいプロファイルに切り替えます。
Multilogin / GoLogin
Section titled “Multilogin / GoLogin”ブラウザプロファイル設定にて:
- Connection type: HTTP Proxy
- Host:
p.shifter.io - Port:
443 - Username:
customer-USERNAME-country-us-sid-<profile-id>-ttl-1800 - Password:
PASSWORD
プロファイルIDをセッションIDとして使用することで、各管理対象ブラウザはセッション全体を通して一貫したIPを保持できます。