Skip to content

WebSocketBadStatusException: Handshake status 403 Forbidden when connecting to >= WebView 111.0.5563.58 #28

@Igorxp5

Description

@Igorxp5

I'm getting following error for recent versions of WebView.

Call: PyChromeDevTools.ChromeInterface(host='127.0.0.1', port=37461, timeout=5)

Stack trace:

    websock.connect(url, **options)
  File "/home/.../.pyenv/versions/venv/lib/python3.10/site-packages/websocket/_core.py", line 253, in connect
    self.handshake_response = handshake(self.sock, url, *addrs, **options)
  File "/home/.../.pyenv/versions/venv/lib/python3.10/site-packages/websocket/_handshake.py", line 57, in handshake
    status, resp = _get_resp_headers(sock)
  File "/home/.../.pyenv/versions/venv/lib/python3.10/site-packages/websocket/_handshake.py", line 147, in _get_resp_headers
    raise WebSocketBadStatusException("Handshake status %d %s", status, status_message, resp_headers)
websocket._exceptions.WebSocketBadStatusException: Handshake status 403 Forbidden

It sems server is not accepting connection from the localhost. When I've added suppress_origin=True to create_connection call it worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions