Connect to localhost if in debug mode.
This commit is contained in:
parent
9128bb1cbb
commit
c9a93dd167
@ -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();
|
||||
|
||||
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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user