multi_server_socket 1.0.2 copy "multi_server_socket: ^1.0.2" to clipboard
multi_server_socket: ^1.0.2 copied to clipboard

discontinued

A dart:io ServerSocket wrapper that listens on multiple ports.

An implementation of dart:io's ServerSocket that wraps multiple servers and forwards methods to all of them. It's useful for listening on multiple network interfaces while still having a unified way of controlling the servers. In particular, it supports serving on both the IPv4 and IPv6 loopback addresses using MultiServerSocket.loopback.

import 'package:multi_server_socket/multi_server_socket.dart';

main() async {
  // Sockets connecting to either http://127.0.0.1:8080 and http://[::1]:8080
  // will be emitted by [server].
  var server = await MultiServerSocket.loopback(8080);

  server.listen((socket) {
    // Communicate with [socket].
  });
}
2
likes
20
points
1.49k
downloads

Publisher

unverified uploader

Weekly Downloads

A dart:io ServerSocket wrapper that listens on multiple ports.

Repository
View/report issues

License

BSD-3-Clause (license)

Dependencies

async

More

Packages that depend on multi_server_socket