You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: audit fails 'Cannot reach … ECONNRESET' on sites that reset browser-like clients; probe ignores [crawler] user_agent #2140
squirrel audit https://example.site/ fails before crawling with:
Cannot reach https://example.site/: ECONNRESET: The socket connection was closed unexpectedly. ...
No audit ran and there is no score.
The site works in a browser and answers curl with a 200. A new user hit this on 11-19 five times in eight minutes on their own site, so it's their first experience of the CLI.
Why
Some servers (here an nginx with a bot filter) reset any connection whose request claims to be Chrome but whose TLS handshake isn't Chrome's. Reproduced with Bun against the affected site:
User-Agent sent
Result
Chrome UA + sec-ch-ua headers (what the CLI sends)
curl shows the same split (HTTP/2 PROTOCOL_ERROR with a Chrome UA, 200 with curl's default or ours).
Two things in the CLI make this unrecoverable:
The reachability probe (apps/cli/src/utils/reachability.ts → requestOnceScoped) always sends CHROME_USER_AGENT plus sec-ch-ua headers (tools/request.ts default config). initRequestTool in controllers/audit.ts only sets the timeout, so a [crawler] user_agent in squirrel.toml never reaches the probe. A user cannot work around it.
ECONNRESET is retried as transient (3 attempts) with the same headers, so it fails the same way three times.
Acceptance Criteria
The reachability probe sends the same User-Agent the crawl will use: the configured [crawler] user_agent when set, otherwise the project's pinned UA.
When the probe's browser-UA attempts end in a connection reset (or an HTTP/2 protocol error) and the honest SquirrelScan/… UA gets an answer, the audit continues with the honest UA for the whole crawl. It says so in one line of output and in the report, so the user knows the site filters browser-like clients.
With [crawler] user_agent set, a site that resets browser UAs is audited (no probe failure).
The unreachable message for a reset names the likely cause and the fix ("the site reset the connection; it may block browser-like clients: set [crawler] user_agent…") instead of the bare socket error.
Tests: a local server that resets requests carrying a Chrome UA and answers others. The probe and crawl succeed via the fallback; a configured UA is used by the probe; fail-before on current main.
Docs: docs/configuration/crawler.mdxuser_agent section mentions this case. The agent skill's troubleshooting is checked for the same advice.
Activity
fix(cli): probe sends [crawler] user_agent and falls back to the hone…