From 9128bb1cbbd0f192c22cf5ba79e4c212cce81b7e Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 18 Dec 2022 16:11:00 +0100 Subject: [PATCH] Remove Platform.localhostname because it is not supported in web app. --- lib/connection/ws_connection.dart | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/connection/ws_connection.dart b/lib/connection/ws_connection.dart index 4ea66dd..0e3d701 100644 --- a/lib/connection/ws_connection.dart +++ b/lib/connection/ws_connection.dart @@ -34,13 +34,10 @@ class ServerConnection { void connect() { if (wasConnected) channel.sink.close(); - if (Platform.localHostname == 'mbook') { - // My test environment - channel = WebSocketChannel.connect(Uri.parse('ws://localhost:8080')); - } else { - channel = - WebSocketChannel.connect(Uri.parse('wss://chess.sw-gross.de:8080')); - } + + channel = + WebSocketChannel.connect(Uri.parse('wss://chess.sw-gross.de:8080')); + log(channel.closeCode.toString()); wasConnected = true;