Connect to localhost if in debug mode.

This commit is contained in:
Marco 2022-12-18 23:06:55 +01:00
parent 9128bb1cbb
commit c9a93dd167

View File

@ -1,6 +1,7 @@
import 'dart:developer';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:mchess/chess_bloc/chess_bloc.dart';
import 'package:mchess/chess_bloc/chess_events.dart';
import 'package:mchess/chessapp/chess_utils.dart';
@ -35,8 +36,12 @@ class ServerConnection {
void connect() {
if (wasConnected) channel.sink.close();
channel =
WebSocketChannel.connect(Uri.parse('wss://chess.sw-gross.de:8080'));
if (kDebugMode) {
channel = WebSocketChannel.connect(Uri.parse('ws://localhost:8080'));
} else {
channel =
WebSocketChannel.connect(Uri.parse('wss://chess.sw-gross.de:8080'));
}
log(channel.closeCode.toString());