Skip to content

[Bug]: page.route_web_socket doesn't intercept the ws connection #2686

@nishirken

Description

@nishirken

Version

1.49.1

Steps to reproduce

The test code uses a custom chromium path. TEST_BROWSER_PATH.

  1. Clone https://github.com/nishirken/websocket-test
  2. Install uv pip install uv
  3. Install deps uv sync && npm i
  4. Launch the client python -m http.server 8000
  5. Launch the server uv run server.py
  6. Launch the python test uv run test_websocket.py
  7. Launch the ts test npx ts-node test_websocket.ts

Expected behavior

The python and ts versions should behave the same.
The python version prints a message when the WebSocket route is established and sends a fake message to the client. (The ts version does it as expected)

Actual behavior

No logs and no messages in the python version.

Additional context

No response

Environment

- Operating System: Linux 6.11 NixOS 24.05 (Uakari) 24.05 (Uakari)
- CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
- Browser: Chromium
- Python Version: [3.11.10]
- Other info:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions