Viewing version 0.0.1+1. Open the latest package page.
shelf_web_socket
0.0.1+1A WebSocket handler for Shelf.
Readme
Web Socket Handler for Shelf
shelf_web_socket is a Shelf handler for establishing WebSocket
connections. It exposes a single function, webSocketHandler, which calls an
onConnection callback with a CompatibleWebSocket object for every
connection that's established.
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_web_socket/shelf_web_socket.dart';
void main() {
var handler = webSocketHandler((webSocket) {
webSocket.listen((message) {
webSocket.add("echo $message");
});
});
shelf_io.serve(handler, 'localhost', 8080).then((server) {
print('Serving at ws://${server.address.host}:${server.port}');
});
}
Changelog
0.0.1+1
- Properly parse the
Connectionheader. This fixes an issue where Firefox was unable to connect.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'shelf_web_socket:0.0.1+1'pubspec.yaml
name: shelf_web_socket
version: 0.0.1+1
author: "Dart Team <misc@dartlang.org>"
homepage: http://www.dartlang.org
description: >
A WebSocket handler for Shelf.
dependencies:
http_parser: ">=0.0.2 <0.1.0"
shelf: ">=0.5.2 <0.6.0"
dev_dependencies:
http: ">=0.10.0 <0.12.0"
unittest: ">=0.10.0 <0.12.0"
environment:
sdk: ">=1.4.0-dev.5.0 <2.0.0"
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.0.1 | Cached · Upstream SHA-256 matched | Download | 58ff7d45…455f32 |
| 0.0.1+1 | Cached · Upstream SHA-256 matched | Download | ad48f05a…a3078a |
| 0.0.1+2 | Cached · Upstream SHA-256 matched | Download | 42fdfbe2…d2b99d |
| 0.0.1+3 | Cached · Upstream SHA-256 matched | Download | 7892a400…ecc5de |
| 0.0.1+4 | Cached · Upstream SHA-256 matched | Download | f2a7cea6…142ff4 |
| 0.0.1+5 | Cached · Upstream SHA-256 matched | Download | d05f869b…960662 |
| 0.1.0 | Cached · Upstream SHA-256 matched | Download | 4821e5f2…d89e47 |
| 0.2.0 | Cached · Upstream SHA-256 matched | Download | 8c4b140a…ec4407 |
| 0.2.1 | Cached · Upstream SHA-256 matched | Download | 48e26601…3fa357 |
| 0.2.2 | Cached · Upstream SHA-256 matched | Download | e0ac3cb8…f3c63e |
| 0.2.2+1 | Cached · Upstream SHA-256 matched | Download | beed8315…cfe822 |
| 0.2.2+2 | Cached · Upstream SHA-256 matched | Download | e8d07a73…53d2a3 |
| 0.2.2+3 | Cached · Upstream SHA-256 matched | Download | 79bcc3cd…a8cedf |
| 0.2.2+4 | Cached · Upstream SHA-256 matched | Download | 2a56a104…e418cf |
| 0.2.2+5 | Cached · Upstream SHA-256 matched | Download | 5a6c9bb7…3b27d9 |
| 0.2.3 | Cached · Upstream SHA-256 matched | Download | 31ff82cb…886ec7 |
| 0.2.4 | Cached · Upstream SHA-256 matched | Download | e20ec869…b7c5c2 |
| 0.2.4+1 | Cached · Upstream SHA-256 matched | Download | 2a300f6d…1b20d1 |
| 1.0.0 | Cached · Upstream SHA-256 matched | Download | 520368a1…ebc6fc |
| 1.0.1 | Cached · Upstream SHA-256 matched | Download | fd84910b…00332d |
| 1.0.2 | Cached · Upstream SHA-256 matched | Download | 6db16374…b08afc |
| 1.0.3 | Cached · Upstream SHA-256 matched | Download | a988c0e8…7156e8 |
| 1.0.4 | Cached · Upstream SHA-256 matched | Download | 9ca081be…7a84c1 |
| 2.0.0 | Cached · Upstream SHA-256 matched | Download | 073c1472…4ac611 |
| 2.0.1 | Cached · Upstream SHA-256 matched | Download | cc36c297…023b67 |
| 3.0.0 | Cached · Upstream SHA-256 matched | Download | 3632775c…580925 |
Dependencies
http_parser "\u003e=0.0.2 \u003c0.1.0"
shelf "\u003e=0.5.2 \u003c0.6.0"