Skip to content

fix: preserve HTTP scheme for realtime TTS endpoints - #899

Open
Apeksha9389 wants to merge 1 commit into
elevenlabs:mainfrom
Apeksha9389:fix/realtime-http-websocket
Open

Apeksha9389 wants to merge 1 commit into
elevenlabs:mainfrom
Apeksha9389:fix/realtime-http-websocket

Conversation

@Apeksha9389

Copy link
Copy Markdown
Contributor

Streaming TTS currently rewrites every configured endpoint to wss:// before calling build_ws_url. With ElevenLabs(base_url="http://localhost:8080/proxy"), this attempts TLS against a plain HTTP proxy, unlike the shared URL helper and other realtime clients.

Pass the original base URL to build_ws_url, which already maps HTTP to WS and HTTPS to WSS while preserving the base path. Only the hand-maintained wrapper and its tests are changed, as required by .fernignore.

Validation: the new public-client regression fails before the change and passes afterward. All 23 streaming-TTS parameter and URL-helper tests pass, and Ruff passes on both changed files. No live provider requests were made.

@cursor

cursor Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Narrow change to realtime TTS URL construction with a targeted regression test; HTTPS production URLs still become wss:// via build_ws_url.

Overview
Realtime streaming TTS no longer rewrites the configured base_url to wss:// in the client constructor. It now stores the original base URL and lets build_ws_url map http→ws and https→wss, including proxy paths like http://localhost:8080/proxy.

This fixes local or plain-HTTP proxies that previously attempted TLS because the URL was forced to wss:// before the shared helper ran.

A regression test drives ElevenLabs with an HTTP base_url and asserts the websocket connect URL starts with ws:// and keeps the proxy path prefix.

Reviewed by Cursor Bugbot for commit 7acf085. Bugbot is set up for automated code reviews on this repo. Configure here.

This branch has not been deployed

No deployments
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.

1 participant