pub repository
mirror.p-hatan.irhttp_multi_server
2.0.1A dart:io HttpServer wrapper that handles requests from multiple servers.
Readme
An implementation of dart:io's HttpServer that wraps multiple servers and
forwards methods to all of them. It's useful for serving the same application 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 HttpMultiServer.loopback.
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() {
// Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same
// server.
HttpMultiServer.loopback(8080).then((server) {
shelf_io.serveRequests(server, (request) {
return new shelf.Response.ok("Hello, world!");
});
});
}
Changelog
2.0.1
- Fix most strong mode errors and warnings.
2.0.0
-
Breaking: Change the signature of
HttpMultiServer.loopbackSecure()to match the new Dart 1.13HttpServer.bindSecure()signature. This removes thecertificateNamenamed parameter and adds the requiredcontextparameter and the namedv6Onlyandsharedparameters. -
Added
v6Onlyandsharedparameters toHttpMultiServer.loopback()to matchHttpServer.bind().
1.3.2
-
Eventually stop retrying port allocation if it fails repeatedly.
-
Properly detect socket errors caused by already-in-use addresses.
1.3.1
loopback()andloopbackSecure()recover gracefully if an ephemeral port is requested and the located port isn't available on both IPv4 and IPv6.
1.3.0
- Add support for
HttpServer.autoCompress.
1.2.0
-
Add support for
HttpServer.defaultResponseHeaders.clear. -
Fix
HttpServer.defaultResponseHeaders.removeand.removeAll.
1.1.0
- Add support for
HttpServer.defaultResponseHeaders.
1.0.2
- Remove the workaround for issue 19815.
1.0.1
- Ignore errors from one of the servers if others are still bound. In particular, this works around issue 19815 on some Windows machines where IPv6 failure isn't discovered until we try to connect to the socket.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add http_multi_serverpubspec.yaml
name: http_multi_server
version: 2.0.1
author: "Dart Team <misc@dartlang.org>"
homepage: http://github.com/dart-lang/http_multi_server
description:
A dart:io HttpServer wrapper that handles requests from multiple servers.
dev_dependencies:
async: "^1.2.0"
test: ">=0.12.0 <0.13.0"
http: ">=0.11.0 <0.12.0"
environment:
sdk: ">=1.13.0 <2.0.0"
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 1.0.0 | 2014-06-05T00:44:24.680320Z | Download | ac3d3489be922a8d3a6eb35ae340d1dc33edd2ade69f388467cb5c128de3e523 |
| 1.0.1 | 2014-07-24T01:43:07.790940Z | Download | 1d51e9872300c66a26555484478feda13953e22f3a909aa1646e8fa346205d3f |
| 1.1.0 | 2014-08-14T00:43:40.284200Z | Download | 49147538e5688a0188ba32b70032ca5ce8a0a302dcc118025327da9b9c589e86 |
| 1.2.0 | 2014-08-14T01:26:35.333710Z | Download | ac5729842d1f11529870e20f91cc3ae099218fd4055d488cc193c0b58a5dd990 |
| 1.3.0 | 2014-09-23T22:01:46.893480Z | Download | da5739ebfd9db3382d06601507609f106c708868ab719218945bb93ecc3fe9e9 |
| 1.3.0+1 | 2014-09-24T00:52:03.619630Z | Download | bb0e759c3d7950a2cd0f1fd3a3630ca43635e042f7945c02c2fe0c9f80560bf5 |
| 1.3.1 | 2015-03-09T22:04:43.456140Z | Download | 7e95c8f788b19cddf79f155f9e6c1685cc23bcb30cb1fbc88dc02fcff1bc135b |
| 1.3.2 | 2015-03-10T19:44:35.246270Z | Download | 62ec3e225b64802412663f13c675b6d1f5eb8f00237b46ddc1bbaec42fc9eafe |
| 2.0.0 | 2015-12-09T00:53:17.827Z | Download | f41a6974ed4ed129fdca3a5aac3a3814be0576007bbdc6824c533c58206de5b8 |
| 2.0.1 | 2016-04-01T00:12:55.220Z | Download | 3205a77bebf411a548e07569ceff405b9b325a1546140a9cfa88aa8e482e4e89 |
| 2.0.2 | 2016-06-20T21:21:15.866Z | Download | 968271c0859af1af6782e4a94370fc6f0659fffcc66a728fcc7ae18ad5a95f92 |
| 2.0.3 | 2016-10-25T21:14:44.078Z | Download | 3f68607027cce2bc531ae66b0bbdae89aea82361f4f2fcaa42fb5f9644ce0113 |
| 2.0.4 | 2017-09-22T20:43:30.021279Z | Download | 4e6f3886e05c853583c0d38d229f4a93fe7a444628d50bce409a242956003108 |
| 2.0.5 | 2018-06-01T17:15:04.474545Z | Download | 795abe4073b3dd82761d09d81e465a8cc2abd7299a223e8fd0ef8a3fbb20505e |
| 2.0.6 | 2019-04-25T19:45:26.888914Z | Download | f9a41fada88ed9535007c3d2419996a6ccf0fdfc5a560f93ace69ad476e2a662 |
| 2.1.0 | 2019-06-04T21:51:46.615623Z | Download | e4eb93a4ad33e86d52e097c07a023c3091cad5d097ba01627450701ae64d6252 |
| 2.2.0 | 2020-01-31T18:53:02.040410Z | Download | 90daef58b775dc37bc409f4053763503f6544f6af7c910d2c2a7f1946554e5e5 |
| 3.0.0 | 2021-02-25T22:09:37.000463Z | Download | ac10cae1b9a06fb638a92a72b00570bac856f524f7ee0d9a13eaed4960c7fd43 |
| 3.0.1 | 2021-04-12T22:47:58.077126Z | Download | bfb651625e251a88804ad6d596af01ea903544757906addcb2dcdf088b5ea185 |
| 3.2.0 | 2022-02-10T20:10:12.621393Z | Download | ab298ef2b2acd283bd36837df7801dcf6e6b925f8da6e09efb81111230aa9037 |
| 3.2.1 | 2022-06-15T20:51:11.594942Z | Download | 97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b |
| 3.2.2 | 2024-12-17T12:50:20.600442Z | Download | aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 |
| 3.2.3 | 2026-10-21T00:13:10.434498Z | Download | 361668bdd71f0ae2dc6d17b75a593520f3c414af6534f9eed1aa72049dd71d18 |
Dependencies
No direct dependencies declared.