Skip to content

Conversation

AgnayS
Copy link

@AgnayS AgnayS commented Jul 31, 2025

Problem

When launching Camoufox server without a proxy, the following error occurs:
Error launching server: proxy: expected object, got null

Root Cause

The launch_options() function always includes "proxy": proxy in the returned dictionary, even when proxy=None. When serialized to JSON and
passed to Playwright's launchServer(), this becomes "proxy": null, which Playwright rejects.

Solution

Only include the proxy key in the returned options when proxy is not None. This matches Playwright's expectation that the proxy parameter
should either be a valid object or completely absent.

Changes

  • Modified the return statement in launch_options() to conditionally include proxy
  • Added conditional logic to exclude None proxy values
  • No breaking changes - existing code continues to work

@AgnayS AgnayS changed the title Refactor launch_options to conditionally include proxy in the result … Fix launch server breaking when no proxy option is passed. Jul 31, 2025
sackmotion pushed a commit to sackmotion/camoufox that referenced this pull request Sep 30, 2025
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.

2 participants