diff --git a/lib/g1/api.dart b/lib/g1/api.dart index f6c2095b2d561976a4a731fb6e83185735879f84..8a99f2fadde161e57a22e07d6d622e8f3f272cf0 100644 --- a/lib/g1/api.dart +++ b/lib/g1/api.dart @@ -1,11 +1,11 @@ import 'dart:convert'; -// import 'dart:developer' as developer; import 'dart:io'; import 'package:durt/durt.dart'; import 'package:flutter/foundation.dart'; import 'package:http/http.dart' as http; import 'package:http/http.dart'; +import 'package:universal_html/html.dart' show window; import '../data/models/contact.dart'; import '../data/models/node.dart'; @@ -469,10 +469,12 @@ String getGvaNode([bool useProxy = true]) { final List<Node> nodes = nodesWorkingList(NodeType.gva); if (nodes.isNotEmpty) { // reorder list to use others + nodes.shuffle(); // Reference of working proxy 'https://g1demo.comunes.net/proxy/g1v1.p2p.legal/gva/'; final String node = useProxy - ? 'https://g1demo.comunes.net/proxy/${nodes.first.url.replaceFirst('https://', '').replaceFirst('http://', '')}/' + // ? 'https://g1demo.comunes.net/proxy/${nodes.first.url.replaceFirst('https://', '').replaceFirst('http://', '')}/' + ? '${window.location.protocol}//${window.location.hostname}/proxy/${nodes.first.url.replaceFirst('https://', '').replaceFirst('http://', '')}/' : nodes.first.url; return node; } else {