You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
409 B
Dart
14 lines
409 B
Dart
import 'dart:convert';
|
|
import 'package:http/http.dart' as http;
|
|
|
|
Future<Map> getTurnCredential(String host, int port) async {
|
|
var url = 'https://$host:$port/api/turn?service=turn&username=flutter-webrtc';
|
|
final res = await http.get(Uri.parse(url));
|
|
if (res.statusCode == 200) {
|
|
var data = json.decode(res.body);
|
|
print('getTurnCredential:response => $data.');
|
|
return data;
|
|
}
|
|
return {};
|
|
}
|