Skip to content

ElevenLabs Agent Connection Failure on Localhost (Allowlist Issue) #320

Description

@Srishanth57

🐞 ElevenLabs Agent Connection Failure on Localhost (Allowlist Issue)

Summary of Issue

When attempting to test the ElevenLabs Conversational Agent locally via the React SDK (or direct WebSocket connection) on http://localhost:3000, the connection is immediately rejected by the ElevenLabs service.

The console repeatedly shows the following errors, indicating a connection stability/security failure:

  1. Host is not supported
  2. Host is not valid or supported
  3. Host is not in insights whitelist
  4. WebSocket is already in CLOSING or CLOSED state. (Secondary error due to immediate connection rejection)

🛠️ Reproduction & Troubleshooting Steps

The core issue appears to be related to the Allowlist format validation for localhost in the Agent's security settings. The production/testing environment works correctly, but localhost fails due to inconsistent validation requirements.

Environment

  • Agent Platform: ElevenLabs Conversational Agent
  • Client Framework: Next.js / React (using @elevenlabs/react)
  • Local URL: http://localhost:3000

Failed Allowlist Attempts

I attempted to add the local host URL to the Agent's Allowlist in the ElevenLabs Dashboard, resulting in the following contradictory validation errors:

Attempted Entry Validation Result Error Explanation
localhost:3000/voice-chat Rejected Hostname should not contain paths (/ character).
https://localhost:3000 Rejected Hostname should not contain the protocol (http://, https://).
localhost:3000 Rejected Hostname must consist of a domain and an optional port (System did not recognize localhost as a sufficient domain).
www.localhost:3000 Accepted (Accepted but Incorrect) This is an invalid origin format and should not be required.
127.0.0.1:3000 Accepted (Accepted - Loopback IP) This format was accepted and is a working workaround.

Conclusion / Expected Fix

The inconsistent validation logic for the Allowlist is preventing the correct origin (localhost:3000) from being added, thus causing the connection rejection on the local machine.

The officially supported format for a local development host (as per typical web standards) should be accepted as either localhost:3000 or http://localhost:3000.

Please confirm the correct, working format for localhost in the Allowlist, or provide a fix for the Allowlist validation system.

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

    bugSomething isn't workingupstreamIssue originates from upstream or generated code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions