Skip to content
pubscout

http_multi_server

3.2.3, released 4 weeks ago by tools.dart.dev

A dart:io HttpServer wrapper that handles requests from multiple servers.

Rock solid
$ flutter pub add http_multi_server
Source repository

What it does

Wraps multiple dart:io HttpServers and forwards methods to all of them. It enables serving the same application on multiple network interfaces with a unified control mechanism, supporting IPv4 and IPv6 loopback addresses.

AI-written summary of version 3.2.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to serve an app on both IPv4 and IPv6 loopback addresses simultaneously
  • You want a unified way to control multiple underlying HTTP servers

Skip it when

  • You only need a single standard HttpServer without multi-interface binding

Strengths

  • Simplifies binding to multiple network interfaces like loopback IPv4 and IPv6
  • Provides a unified interface that mimics dart:io HttpServer

Weaknesses

  • Limited to wrapping dart:io HttpServer use cases
  • Not documented for general HTTP client requests

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:http_multi_server/http_multi_server.dart';
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as shelf_io;

void main() async {
  var server = await HttpMultiServer.loopback(8080);
  shelf_io.serveRequests(server, (request) {
    return shelf.Response.ok("Hello, world!");
  });
}

Alternatives

Packages that do the same job and could replace http_multi_server.

  • sse

    Bidirectional Server Sent Events client and server for Dart.

  • sse_channel

    Wraps Server‑Sent Events as a StreamChannel for Dart IO and web

  • super_dns_client

    A DNS resolver for Dart and Flutter supporting DoH and traditional UDP/TCP lookups.

  • modbus_client

    Base Modbus client package for sending requests via Serial and TCP/IP.

Works with

Packages commonly used together with http_multi_server: ones it builds on, ones built on it, and its own family.