Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare worker compatibility issue with LiveClient #197

Closed
WilliamKeating opened this issue Nov 8, 2023 · 3 comments · Fixed by #199 or #200
Closed

Cloudflare worker compatibility issue with LiveClient #197

WilliamKeating opened this issue Nov 8, 2023 · 3 comments · Fixed by #199 or #200
Assignees
Labels
beta Pending GA release bug Something isn't working

Comments

@WilliamKeating
Copy link

What is the current behavior?

When using the v3 Deepgram SDK in a ClouldFlare worker, the LiveClient constructor creates a WebSocket with an invalid protocol when running deepGram.listen.live({ model: 'nova' });. This results in a "WebSocket Constructor: The protocol header token is invalid" error.

[mf:err] SyntaxError: WebSocket Constructor: The protocol header token is invalid. at new LiveClient at ListenClient.live at Object.fetch at async jsonError

Steps to reproduce

  1. Call deepGram.listen.live({ model: 'nova' }) in ClouldFlare worker with Node.
  2. Observe the "WebSocket Constructor: The protocol header token is invalid" error.

Expected behavior

Not produce error

Please tell us about your environment

  • Operating System/Version: MacOS Ventura
  • Language: TypeScript
  • Browser: Node / ClouldFlare worker
@lukeocodes
Copy link
Contributor

Thanks for letting me know. It seems the cloudflare worker makes the SDK think it's not a browser version of the websocket, and tried to define headers.

I'll look more at this today!

@lukeocodes lukeocodes added the bug Something isn't working label Nov 9, 2023
@lukeocodes lukeocodes changed the title Invalid WebSocket protocol in LiveClient constructor Cloudflare worker compatibility issue with LiveClient Nov 9, 2023
@lukeocodes lukeocodes added the beta Pending GA release label Nov 15, 2023
@lukeocodes lukeocodes self-assigned this Nov 15, 2023
@lukeocodes
Copy link
Contributor

This remains unresolved!

@lukeocodes lukeocodes linked a pull request Nov 16, 2023 that will close this issue
@lukeocodes
Copy link
Contributor

fixed in v3.0.0-beta.4

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