Connect to localhost when I am on my dev environment.
This commit is contained in:
parent
23f6a6b14c
commit
31faabcf94
@ -1,4 +1,5 @@
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:mchess/chess_bloc/chess_bloc.dart';
|
import 'package:mchess/chess_bloc/chess_bloc.dart';
|
||||||
import 'package:mchess/chess_bloc/chess_events.dart';
|
import 'package:mchess/chess_bloc/chess_events.dart';
|
||||||
@ -33,8 +34,13 @@ class ServerConnection {
|
|||||||
|
|
||||||
void connect() {
|
void connect() {
|
||||||
if (wasConnected) channel.sink.close();
|
if (wasConnected) channel.sink.close();
|
||||||
channel =
|
if (Platform.localHostname == 'mbook') {
|
||||||
WebSocketChannel.connect(Uri.parse('wss://chess.sw-gross.de:8080'));
|
// My test environment
|
||||||
|
channel = WebSocketChannel.connect(Uri.parse('ws://localhost:8080'));
|
||||||
|
} else {
|
||||||
|
channel =
|
||||||
|
WebSocketChannel.connect(Uri.parse('wss://chess.sw-gross.de:8080'));
|
||||||
|
}
|
||||||
log(channel.closeCode.toString());
|
log(channel.closeCode.toString());
|
||||||
|
|
||||||
wasConnected = true;
|
wasConnected = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user