Skip to content

Commit

Permalink
Bump sse to v3.1.1 and add server keepalive
Browse files Browse the repository at this point in the history
This allows the server to accept client reconnections and present them transparently to the consuming code (see https://github.com/dart-lang/sse/issues/18).
  • Loading branch information
DanTup committed Jan 27, 2020
1 parent d6898d1 commit b22e30e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dwds/debug_extension/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
js: ^0.6.1+1
pedantic: ^1.5.0
pub_semver: ^1.3.2
sse: ^3.0.0
sse: ^3.1.1

dev_dependencies:
webdev: ^2.0.0
Expand Down
3 changes: 2 additions & 1 deletion dwds/lib/src/handlers/dev_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import '../services/debug_service.dart';
/// opening DevTools.
class DevHandler {
StreamSubscription _sub;
final SseHandler _sseHandler = SseHandler(Uri.parse(r'/$sseHandler'));
final SseHandler _sseHandler = SseHandler(Uri.parse(r'/$sseHandler'),
keepAlive: const Duration(seconds: 30));
final _injectedConnections = Set<SseConnection>();
final DevTools _devTools;
final AssetReader _assetReader;
Expand Down
3 changes: 2 additions & 1 deletion dwds/lib/src/servers/extension_backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import 'package:http_multi_server/http_multi_server.dart';
import 'package:shelf/shelf_io.dart';
import 'package:sse/server/sse_handler.dart';

final _sseHandler = SseHandler(Uri.parse('/\$debug'));
final _sseHandler =
SseHandler(Uri.parse('/\$debug'), keepAlive: const Duration(seconds: 30));

/// A backend for the Dart Debug Extension.
///
Expand Down
2 changes: 1 addition & 1 deletion dwds/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies:
shelf_static: ^0.2.8
shelf_web_socket: ^0.2.0
source_maps: ^0.10.0
sse: ^3.0.0
sse: ^3.1.1
vm_service: 1.2.0
web_socket_channel: ^1.0.0
webkit_inspection_protocol: '>=0.4.0 <0.6.0'
Expand Down
2 changes: 1 addition & 1 deletion webdev/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
shelf: ^0.7.4
shelf_proxy: ^0.1.0+5
shelf_static: ^0.2.8
sse: ^3.0.0
sse: ^3.1.1
vm_service: ^1.1.0
webkit_inspection_protocol: '>=0.4.0 <0.6.0'
yaml: ^2.1.13
Expand Down

0 comments on commit b22e30e

Please sign in to comment.