http_multi_server

所属分类:WEB开发
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2023-09-01 22:53:36
上 传 者sh-1993
说明:  处理来自多个服务器的请求的dart:io HttpServer包装器。,
(A dart:io HttpServer wrapper that handles requests from multiple servers.,)

文件列表:
.test_config (51, 2023-12-01)
CHANGELOG.md (2742, 2023-12-01)
LICENSE (1503, 2023-12-01)
analysis_options.yaml (864, 2023-12-01)
example/ (0, 2023-12-01)
example/main.dart (420, 2023-12-01)
lib/ (0, 2023-12-01)
lib/http_multi_server.dart (8653, 2023-12-01)
lib/src/ (0, 2023-12-01)
lib/src/multi_headers.dart (3456, 2023-12-01)
lib/src/utils.dart (847, 2023-12-01)
pubspec.yaml (365, 2023-12-01)
test/ (0, 2023-12-01)
test/http_multi_server_test.dart (15731, 2023-12-01)

[![Dart CI](https://github.com/dart-lang/http_multi_server/actions/workflows/test-package.yml/badge.svg)](https://github.com/dart-lang/http_multi_server/actions/workflows/test-package.yml) [![pub package](https://img.shields.io/pub/v/http_multi_server.svg)](https://pub.dev/packages/http_multi_server) [![package publisher](https://img.shields.io/pub/publisher/http_multi_server.svg)](https://pub.dev/packages/http_multi_server/publisher) 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][]. ```dart 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 { // Both http://127.0.0.1:8080 and http://[::1]:8080 will be bound to the same // server. var server = await HttpMultiServer.loopback(8080); shelf_io.serveRequests(server, (request) { return shelf.Response.ok("Hello, world!"); }); } ``` [HttpServer]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart-io.HttpServer [HttpMultiServer.loopback]: https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/http_multi_server/http_multi_server.HttpMultiServer#id_loopback

近期下载者

相关文件


收藏者