Skip to content

terminal web UI not working - issue with socket connection #169

Description

@nicolasmendonca

First off: I'm really glad you're building this product. I love it and I really want to work with it!

I tried setting up the perry agent both locally in my macbook pro M3 and In my ubuntu-server based homelab, and I'm running into the same issue in both:

When trying to use the web UI to access my terminal, or create an agent session, I see an error in the console indicating that the websocket connection was refused.

Image

I launched OpenCode on this repo to ask about it, and it hinted me the following:

Root Cause: Authentication
The WebSocket connection is failing because browsers cannot send Authorization headers with WebSocket connections. Here's what happens:
1. The web UI stores the auth token in localStorage and uses it for API calls (via fetch)
2. When opening a WebSocket, the browser cannot include the Authorization: Bearer <token> header
3. Your server has config.auth.token set (auth is enabled)
4. The server rejects the WebSocket upgrade request with 401 Unauthorized
5. This causes the 1006 (abnormal closure) error

Same issue happens with brave and safari.

Thanks again for this cool project

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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