-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add support for custom TURN servers in AnamClient configuration #166
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
feat: add support for custom TURN servers in AnamClient configuration #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for custom ICE servers by allowing users to specify them via the customTurnServers option in the client configuration. When provided, these custom servers override the default ICE servers received from the backend.
Key Changes:
- Added
customTurnServersoptional property toAnamPublicClientOptions - Modified session initialization logic to use custom servers when provided, falling back to server-provided ICE servers
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/types/AnamPublicClientOptions.ts | Added optional customTurnServers field to support custom ICE server configuration |
| src/AnamClient.ts | Implemented logic to use custom ICE servers when provided, refactored ICE server handling with renamed variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/AnamClient.ts
Outdated
| sessionId: this.sessionId, | ||
| }); | ||
|
|
||
| // Use custom TURN server if provided, otherwise use server-provided ICE servers |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment refers to 'custom TURN server' (singular) but the property accepts an array of RTCIceServer which can include both STUN and TURN servers. The comment should be updated to 'Use custom ICE servers if provided, otherwise use server-provided ICE servers' for accuracy and consistency with the codebase terminology.
| // Use custom TURN server if provided, otherwise use server-provided ICE servers | |
| // Use custom ICE servers if provided, otherwise use server-provided ICE servers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Summary
This MR introduces support for configuring custom TURN servers in the AnamClient setup. It allows developers to define their own TURN/STUN infrastructure instead of relying solely on default provider (Metered).
Motivation
Some organizations have strict network policies or limitations that prevent them from allowing wide IP ranges. Providing the ability to use a custom TURN server has less IPs.
Example Usage
Summary by cubic
Added support for custom TURN/STUN servers in AnamClient. If provided, the client uses your RTCIceServer list instead of the server-provided ICE servers.
Written for commit b32620b. Summary will update automatically on new commits.