Skip to content

Proxy improvements: better handling of non-CONNECT requests and observability #42

@pimlock

Description

@pimlock

The sandbox HTTP proxy (crates/navigator-sandbox/src/proxy.rs) is a CONNECT-only proxy. Several improvements have been identified:

1. Return 403 instead of 405 for plain HTTP proxy requests

Currently, when a client sends a forward-proxy style plain HTTP request (e.g. GET http://example.com/ HTTP/1.1), the proxy returns 405 Method Not Allowed. This is technically correct (we don't support that method) but semantically misleading — from the sandboxed process's perspective, the request was denied, not unsupported.

We should return 403 Forbidden instead to align with how HTTPS CONNECT denials are surfaced.

2. Add deny logging for non-CONNECT requests

Plain HTTP proxy requests are currently rejected silently (no structured log). HTTPS CONNECT requests that are denied by policy produce structured deny logs. We should emit a similar log line for rejected non-CONNECT requests so operators have full visibility into all proxy traffic attempts.

The hostname can be extracted from the absolute-form URI in the request line (e.g. http://badstuff.com/pathbadstuff.com).

3. Create cleaner user facing error messages

See first comment.


More items may be added to this issue as additional proxy improvements are identified.


Originally by @johntmyers on 2026-02-25T17:20:13.123-08:00

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions