gopher 0.0.0 copy "gopher: ^0.0.0" to clipboard
gopher: ^0.0.0 copied to clipboard

An implementation of the Gopher (RFC1436) Web protocol in Dart.

gopher.dart #

An implementation of the Gopher protocol in Dart.

Installation #

In your pubspec.yaml:

dependencies:
  gopher: ^1.0.0

Simple Server #

import 'package:gopher/gopher.dart';

main() async {
  var server = await GopherServer.bind('127.0.0.1', 7070);
  print('Listening at gopher://127.0.0.1:7070');
  await for (var request in server) {
    if (request.path == '/hello') {
      request.writeText('Hello, Gopher world!');
    } else {
      request.writeItem(
          GopherItemType.file, ['Hello', '/hello', '127.0.0.1', '7070']);
    }

    await request.close();
  }
}
0
likes
40
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

An implementation of the Gopher (RFC1436) Web protocol in Dart.

Homepage

License

MIT (license)

Dependencies

async, charcode

More

Packages that depend on gopher