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.
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.
80Compare - sse_channel
Wraps Server‑Sent Events as a StreamChannel for Dart IO and web
56Compare - super_dns_client
A DNS resolver for Dart and Flutter supporting DoH and traditional UDP/TCP lookups.
61Compare - modbus_client
Base Modbus client package for sending requests via Serial and TCP/IP.
56Compare
Works with
Packages commonly used together with http_multi_server: ones it builds on, ones built on it, and its own family.
- asynchttp_multi_server depends on itUtility classes and helpers that extend Dart's async library.
- http_profileSame familyAllows custom HTTP client authors to integrate requests with the DevTools Network View.
- testBuilt on http_multi_serverA full featured library for writing and running Dart tests across platforms.
- ddsBuilt on http_multi_serverLibrary to spawn and communicate with the Dart Developer Service (DDS) via HTTP, WebSocket, or SSE.
- dwdsBuilt on http_multi_serverProxies between the Chrome debug protocol and the Dart VM service protocol.
- build_runnerBuilt on http_multi_serverA build system for Dart code generation and modular compilation.
- build_daemonBuilt on http_multi_serverDaemon for running Dart builds in the background
- patrolBuilt on http_multi_serverMultiplatform E2E UI testing framework for Flutter