chrome_os_io 0.2.1 chrome_os_io: ^0.2.1 copied to clipboard
Enables use of 'dart:io' networking classes in Chrome OS Apps.
Introduction #
This package enables use of 'dart:io' networking APIs in Chrome OS Apps.
Supported 'dart:io' APIs include:
- RawDatagramSocket (using chrome.sockets.udp)
- Socket and RawSocket (using chrome.sockets.tcp)
- ServerSocket and RawServerSocket (using chrome.sockets.tcpServer)
The package is implemented as a driver for package:universal_io. Licensed under the Apache License 2.0. A few files in the package were obtained from package:chrome under the BSD 2-Clause License.
Contributing #
Unfortunately writing automatic tests for Chrome OS Apps is painful. At the moment, the project uses the following manual workflow:
- Compile the example app.
- Open Chrome OS page "chrome://extensions".
- Click "Load unpacked extension"
- Use buttons in the web app for running tests.
- Look at the console (to be sure nothing is wrong).
Related packages #
- chrome
- For Chrome extensions.
- webext
- For Google Chrome, Mozilla Firefox, and Microsoft Edge extensions.
- webextdev
- A tool for browser extension developers.
Getting started #
In pubspec.yaml:
dependencies:
chrome_os_io: ^0.1.0
In main.dart:
import 'package:chrome_os_io/chrome_os_io.dart';
import 'package:universal_io/io.dart';
void main() async {
chromeIODriver.enable();
// 'dart:io' works now!
final socket = await Socket.connect("localhost", 8080);
}