shelf_unix_domain_socket 1.0.0 copy "shelf_unix_domain_socket: ^1.0.0" to clipboard
shelf_unix_domain_socket: ^1.0.0 copied to clipboard

Extension library for Shelf to supports unix domain socket.

example/shelf_unix_domain_socket_example.dart

import 'dart:io';

import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_unix_domain_socket/shelf_unix_domain_socket.dart';

void main() async {
  var handler =
      const Pipeline().addMiddleware(logRequests()).addHandler(_echoRequest);

  var server = await File('/tmp/server.sock').bindHttpServer();
  print('listen: ${server.address}');
  shelf_io.serveRequests(server, handler);
}

Response _echoRequest(Request request) =>
    Response.ok('Request for "${request.url}"');
0
likes
0
pub points
44%
popularity

Publisher

verified publisherkkazuo.com

Extension library for Shelf to supports unix domain socket.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

posix

More

Packages that depend on shelf_unix_domain_socket