Skip to content

Commit

Permalink
fix scheme replace for url.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Aug 21, 2024
1 parent c405f23 commit 58a4b3a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/support/region_url_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,21 @@ extension RegionSettingsExtension on lk_models.RegionSettings {
);
}

bool isCloudUrl(Uri url) {
return url.host.contains('.livekit.cloud') ||
url.host.contains('.livekit.run');
bool isCloudUrl(Uri uri) {
return uri.host.contains('.livekit.cloud') ||
uri.host.contains('.livekit.run');
}

String toHttpUrl(String url) {
if (url.startsWith('ws')) {
return url.replaceAll('ws', 'http');
return url.replaceFirst('ws', 'http');
}
return url;
}

String toWebsocketUrl(String url) {
if (url.startsWith('http')) {
return url.replaceAll('http', 'ws');
return url.replaceFirst('http', 'ws');
}
return url;
}

0 comments on commit 58a4b3a

Please sign in to comment.