Skip to content

feat: add /fetch endpoint for browser-backed HTTP requests#205

Closed
masnwilliams wants to merge 1 commit into
mainfrom
hypeship/add-fetch-endpoint
Closed

feat: add /fetch endpoint for browser-backed HTTP requests#205
masnwilliams wants to merge 1 commit into
mainfrom
hypeship/add-fetch-endpoint

Conversation

@masnwilliams

Copy link
Copy Markdown
Contributor

Summary

  • Adds POST /fetch endpoint to the VM Go server that proxies HTTP requests through Chromium's built-in forward proxy (from kernel-browser PR Nuke containers/ #20)
  • Configures chromium-launcher to pass --forward-proxy-port=8888 flag to Chromium at startup
  • Adds FORWARD_PROXY_PORT env config (default 8888)
  • Full OpenAPI spec + codegen for request/response schemas

How it works

Client sends POST /fetch { url, method, headers, body, timeout_ms } → VM server builds request to http://localhost:8888/proxy?url=<target> → Chromium's forward proxy routes through Chrome's full network stack → response flows back with status, headers, body, duration_ms.

Inherits TLS fingerprint, cookies, proxy config, and default headers automatically.

Companion PR

  • kernel/kernel#1684 — API layer (POST /browsers/{id}/fetch)

Test plan

  • Verify chromium-launcher passes --forward-proxy-port flag
  • Test /fetch endpoint against httpbin with GET/POST
  • Test cookie inheritance (navigate → set cookie → fetch reads cookie)
  • Test error cases (invalid URL, unreachable proxy, timeout)
  • E2E test with headless image

🤖 Generated with Claude Code

Adds POST /fetch to the VM server that proxies HTTP requests through
Chromium's built-in forward proxy, inheriting TLS fingerprint, cookies,
proxy config, and default headers without rendering a page.

- Configure chromium-launcher to pass --forward-proxy-port flag
- Add FORWARD_PROXY_PORT config (default 8888)
- Add /fetch endpoint to OpenAPI spec with request/response schemas
- Implement BrowserFetch handler proxying to localhost forward proxy
- Regenerate oapi-codegen output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant