diff --git a/README.md b/README.md index a8622c1a..150cb6ee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # angel_websocket -[![1.0.0-dev+10](https://img.shields.io/badge/pub-1.0.0--dev+10-red.svg)](https://pub.dartlang.org/packages/angel_websocket) +[![1.0.0](https://img.shields.io/badge/pub-1.0.0-brightgreen.svg)](https://pub.dartlang.org/packages/angel_websocket) [![build status](https://travis-ci.org/angel-dart/websocket.svg)](https://travis-ci.org/angel-dart/websocket) WebSocket plugin for Angel. diff --git a/lib/base_websocket_client.dart b/lib/base_websocket_client.dart index 23dc9f1f..351deeb4 100644 --- a/lib/base_websocket_client.dart +++ b/lib/base_websocket_client.dart @@ -234,7 +234,7 @@ class BaseWebSocketService extends Service { } @override - Future index([Map params]) async { + Future index([Map params]) async { socket.sink.add(serialize(new WebSocketAction( eventName: '$path::${ACTION_INDEX}', params: params ?? {}))); return null; diff --git a/lib/browser.dart b/lib/browser.dart index 32cd6581..8affcc95 100644 --- a/lib/browser.dart +++ b/lib/browser.dart @@ -38,13 +38,14 @@ class WebSockets extends BaseWebSocketClient { WebSocketsService service(String path, {Type type, AngelDeserializer deserializer}) { String uri = path.replaceAll(_straySlashes, ''); - return new WebSocketsService(socket, this, uri, null); + return new WebSocketsService(socket, this, uri, deserializer: deserializer); } } class WebSocketsService extends BaseWebSocketService { final Type type; - WebSocketsService(WebSocketChannel socket, Angel app, String uri, this.type) - : super(socket, app, uri); + WebSocketsService(WebSocketChannel socket, Angel app, String uri, + {this.type, AngelDeserializer deserializer}) + : super(socket, app, uri, deserializer: deserializer); } diff --git a/lib/server.dart b/lib/server.dart index cb5fc37b..032b1c1f 100644 --- a/lib/server.dart +++ b/lib/server.dart @@ -91,7 +91,7 @@ class AngelWebSocket extends AngelPlugin { if (result == true) { var serialized = event.toJson(); _printDebug('Batching this event: $serialized'); - print('Serialized: ' + JSON.encode(serialized)); + // print('Serialized: ' + JSON.encode(serialized)); client.io.add(god.serialize(event.toJson())); } }); @@ -117,7 +117,11 @@ class AngelWebSocket extends AngelPlugin { var params = mergeMap([ god.deserializeDatum(action.params), - {"provider": Providers.WEBSOCKET} + { + "provider": Providers.WEBSOCKET, + '__requestctx': socket.request, + '__responsectx': socket.response + } ]); try { diff --git a/pubspec.yaml b/pubspec.yaml index 6bcc7358..b92a8a6c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: angel_websocket description: WebSocket plugin for Angel environment: sdk: ">=1.19.0" -version: 1.0.0-dev+10 +version: 1.0.0 author: Tobe O homepage: https://github.com/angel-dart/angel_websocket dependencies: