Skip to content

Commit

Permalink
Merge pull request #20 from DrMarcII/shelf_fix
Browse files Browse the repository at this point in the history
Fix multiplexor to work with latest version of shelf.
  • Loading branch information
DrMarcII committed Feb 22, 2016
2 parents 339f3b6 + be3dbf9 commit 706e3d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ pubspec.lock
docs/
build/
.settings/
.packages
8 changes: 5 additions & 3 deletions lib/multiplex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class Server {
.add(_webSocket)
.add(_mainPage)
.add(_json)
.add(_forward).handler);
.add(_forward)
.handler);

void _shelfLogger(String msg, bool isError) {
if (isError) {
Expand Down Expand Up @@ -123,7 +124,7 @@ class Server {
}
_log.info('connecting to websocket: ${request.url}');

return ws.webSocketHandler((ws) async {
return ws.webSocketHandler((WebSocketChannel ws) async {
var debugger = await _connections.putIfAbsent(path[2], () async {
var tab = await chrome.getTab((tab) => tab.id == path[2]);
return WipConnection.connect(tab.webSocketDebuggerUrl);
Expand All @@ -134,7 +135,8 @@ class Server {
return new WipDomModel(debugger.dom);
});
}
var forwarder = new WipForwarder(debugger, ws, domModel: dom);
var forwarder =
new WipForwarder(debugger, ws.stream, sink: ws.sink, domModel: dom);
debugger.onClose.listen((_) {
_connections.remove(path[2]);
_modelDoms.remove(path[2]);
Expand Down
10 changes: 5 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: webkit_inspection_protocol
version: 0.1.2
version: 0.2.0
description: A client for the Webkit Inspection Protocol (WIP).

homepage: https://github.com/google/webkit_inspection_protocol.dart
Expand All @@ -12,8 +12,8 @@ environment:
dependencies:
args: '^0.13.2'
logging: '^0.11.1'
shelf: '^0.6.2'
shelf_web_socket: '^0.0.1+2'
shelf: '^0.6.5'
shelf_web_socket: '^0.1.0'
dev_dependencies:
shelf_static: '^0.2.2'
test: '^0.12.3+5'
shelf_static: '^0.2.3'
test: '^0.12.3'

0 comments on commit 706e3d4

Please sign in to comment.