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.
HMG_Patient_App/lib/pages/videocall-webrtc-rnd/utils/turn_web.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 {};
}