TxServerConfiguration class

Configuration for Telnyx server connections including host, port, and ICE servers.

This class provides factory methods to create production or development server configurations with appropriate TURN/STUN server settings.

The configuration supports:

  • Custom signaling server host and port
  • Custom ICE servers array (TURN/STUN)
  • Environment-based default configurations

Example usage:

// Use default production configuration
final config = TxServerConfiguration.production();

// Use custom ICE servers
final customConfig = TxServerConfiguration(
  webRTCIceServers: [
    TxIceServer(urls: ['stun:stun.example.com:3478']),
    TxIceServer(
      urls: ['turn:turn.example.com:3478?transport=tcp'],
      username: 'user',
      credential: 'pass',
    ),
  ],
);

Constructors

TxServerConfiguration({String host = DefaultConfig.telnyxProdHostAddress, int port = DefaultConfig.telnyxPort, String? turn, String? stun, List<TxIceServer>? webRTCIceServers, WebRTCEnvironment environment = WebRTCEnvironment.production})
Creates a server configuration with the specified parameters.

Properties

environment WebRTCEnvironment
The WebRTC environment (production or development).
final
hashCode int
The hash code for this object.
no setterinherited
host String
The host address for the WebSocket connection.
final
port int
The port for the WebSocket connection.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socketUrl String
Returns the full WebSocket URL for this configuration.
no setter
stun String
The STUN server URL for ICE candidates.
final
turn String
The TURN server URL for ICE candidates.
final
webRTCIceServers List<TxIceServer>
The list of ICE servers for WebRTC peer connections.
final

Methods

copyWith({String? host, int? port, String? turn, String? stun, List<TxIceServer>? webRTCIceServers, WebRTCEnvironment? environment}) TxServerConfiguration
Creates a copy of this configuration with the specified changes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

development({List<TxIceServer>? webRTCIceServers}) TxServerConfiguration
Creates a development server configuration with default development values.
production({List<TxIceServer>? webRTCIceServers}) TxServerConfiguration
Creates a production server configuration with default production values.