diff options
Diffstat (limited to 'lib/vehicle-signals/vehicle_config.dart')
-rw-r--r-- | lib/vehicle-signals/vehicle_config.dart | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/vehicle-signals/vehicle_config.dart b/lib/vehicle-signals/vehicle_config.dart deleted file mode 100644 index 59682c4..0000000 --- a/lib/vehicle-signals/vehicle_config.dart +++ /dev/null @@ -1,39 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -import 'dart:convert'; -import 'dart:io'; - -import 'package:dashboard_app/config.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:http/http.dart' as http; - - - -final sockConnectprovider = FutureProvider.family<WebSocket, HttpClient>( - (ref, client) => connect(client,ref)); - - - -Future<HttpClient> initializeClient() async { - - - SecurityContext ctx = SecurityContext.defaultContext; - - HttpClient client = HttpClient(context: ctx) - ..findProxy = null - ..badCertificateCallback = (cert, host, port) { - return true; - }; - return client; -} - - - -Future<WebSocket> connect(HttpClient client, ref) async { - final config = ref.read(ConfigStateprovider); - WebSocket socket = await WebSocket.connect( - "wss://${config.hostname}:${config.port}", - customClient: client); - return socket; -} - - |