Launch Module: Chrome + Relay + Playwright
Architecture
Windows Chrome (--remote-debugging-port=9222)
↕ Relay2.exe (0.0.0.0:9255 → 127.0.0.1:9222)
Windows IP (172.24.48.1:9255)
↕ WSL chrome_relay.py (127.0.0.1:19223 → 172.24.48.1:9255)
↕ Playwright connect_over_cdp('http://127.0.0.1:19223')
Step A: Launch Chrome (Windows)
# First kill old Chrome processes
taskkill /F /IM chrome.exe
# Start Chrome with debug port
cmd.exe /c start "" "C:\Program Files\Google\Chrome\Application\chrome.exe" \
--remote-debugging-port=9222 \
--user-data-dir="C:\Users\[Your Windows Username]\Desktop\chrome-debug"
⚠️ Must use a dedicated --user-data-dir (e.g., chrome-debug); the default profile cannot bind to port 9222.
Step B: Launch Relay2 (Windows)
Relay2.exe should run automatically at Windows startup:
C:\Users\[Your Windows Username]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\hermes-gateway.vbs
To start manually: double-click Relay2.exe.
Step C: Start WSL Relay
cd ~/.hermes/scripts && python3 chrome_relay.py &
Step D: Verify the Chain
# Check WSL relay
curl -s http://127.0.0.1:19223/json | head -5
# Should return JSON list of Chrome tabs
Step E: Playwright Connection
from playwright.async_api import async_playwright
async with async_playwright() as p:
browser = await p.chromium.connect_over_cdp('http://127.0.0.1:19223')
pages = browser.contexts[0].pages
# Check open tabs
Login Check
Dianxiaomi Login
Navigate to Dianxiaomi → verify if logged in (look for [Your Dianxiaomi Username] on the page):
document.body.innerText.includes('[Your Dianxiaomi Username]')
If not logged in, use QR code login: Dianxiaomi top-right corner → Scan QR code to log in.
1688 Login
Check 1688 login status: Open any 1688 product page → see if there is a "Log In" button.
document.body.innerText.includes('Log In')
If not logged in, log in manually (1688 CAPTCHA cannot be automated).
Failure Recovery
Gateway Disconnection Reconnection Rules
Fatal error: Directly calling browser_navigate creates a new tab, losing already-filled data.
Correct steps:
1. browser_cdp → Target.getTargets # List all tabs
2. Find Dianxiaomi edit page (title="Dianxiaomi--Edit AliExpress Product")
3. Runtime.evaluate to read page state (title/hash/bodyText)
4. Confirm which tab has filled data
5. Target.closeTarget to close blank/duplicate tabs
6. Target.activateTarget to activate the correct tab
7. Now browser_snapshot should show filled data
Full Chain Down
# WSL side
pkill -f chrome_relay.py
cd ~/.hermes/scripts && python3 chrome_relay.py &
# Windows side (manually or triggered from WSL)
taskkill /F /IM chrome.exe
# Restart Chrome (Step A)
Author: SouthernSpark | Xiaohongshu @SouthernSpark | AI Automation Expert Workflow