multi_server_socket 1.0.1

  • Installing
  • Versions
  • 93

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 and http://[::1]:8080
  // will be emitted by [server].
  var server = await MultiServerSocket.loopback(8080);

  server.listen((socket) {
    // Communicate with [socket].


  • Support package:async v2.


  • Initial release.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  multi_server_socket: "^1.0.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:multi_server_socket/multi_server_socket.dart';
Version Uploaded Documentation Archive
1.0.1 Jan 3, 2018 Go to the documentation of multi_server_socket 1.0.1 Download multi_server_socket 1.0.1 archive
1.0.0 Dec 1, 2017 Go to the documentation of multi_server_socket 1.0.0 Download multi_server_socket 1.0.0 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
88 / 100
Code health derived from static analysis. [more]
94 / 100
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:multi_server_socket/multi_server_socket.dart with components: io.


  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use multi_server_socket.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Strong-mode analysis of lib/multi_server_socket.dart gave the following hint:

    line: 65 col: 54
    'LOOPBACK_IP_V6' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/utils.dart gave the following hint:

    line: 11 col: 58
    'LOOPBACK_IP_V6' is deprecated and shouldn't be used.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0
async >=1.2.0 <3.0.0 2.0.7
Transitive dependencies
collection 1.14.10
Dev dependencies
test ^0.12.0