File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:grpc/grpc.dart' ;
2
+
3
+ ClientChannel getKkweonOktetoChannel () {
4
+ return ClientChannel ('ingress-kkweon.cloud.okteto.net' );
5
+ }
Original file line number Diff line number Diff line change
1
+ import 'package:grpc/grpc_web.dart' ;
2
+
3
+ GrpcWebClientChannel getKkweonOktetoChannel () {
4
+ // return GrpcWebClientChannel.xhr(Uri.parse("https://envoy-kkweon.cloud.okteto.net"));
5
+ return GrpcWebClientChannel .xhr (Uri .parse ("https://envoy-kkweon.cloud.okteto.net/" ));
6
+ }
Original file line number Diff line number Diff line change 1
1
import 'package:grpc/grpc.dart' ;
2
+ import 'package:pr12er/grpc_channel_native.dart'
3
+ if (dart.library.js) 'package:pr12er/grpc_channel_web.dart' ;
2
4
import 'package:pr12er/protos/pkg/pr12er/messages.pb.dart' ;
3
5
4
6
import 'protos/pkg/pr12er/service.pbgrpc.dart' ;
@@ -7,7 +9,7 @@ class GrpcClient {
7
9
// Use _getLocalhostChannel(port: 9000) to use the localhost version.
8
10
// NOTE: localhost only works in iOS.
9
11
final Pr12erServiceClient _client =
10
- Pr12erServiceClient (_getKkweonOktetoChannel ());
12
+ Pr12erServiceClient (getKkweonOktetoChannel ());
11
13
12
14
Future <String > sendMessage (String message) async {
13
15
final request = HelloRequest ()..body = message;
@@ -31,15 +33,11 @@ class GrpcClient {
31
33
}
32
34
}
33
35
34
- ClientChannel _getKkweonOktetoChannel () {
35
- return ClientChannel ('ingress-kkweon.cloud.okteto.net' );
36
- }
37
-
38
36
// ignore: unused_element
39
37
ClientChannel _getLocalhostChannel ({required int port}) {
40
38
return ClientChannel (
41
39
'localhost' ,
42
40
port: port,
43
41
options: const ChannelOptions (credentials: ChannelCredentials .insecure ()),
44
42
);
45
- }
43
+ }
You can’t perform that action at this time.
0 commit comments