搜索插件、代码仓与 APP 分类

插件详情v1.0.5

shelf_proxy

用于将 HTTP 请求代理到另一台服务器的 shelf 处理程序。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1000万
喜欢数
94
Pub 分数
160

安装插件

flutter pub add shelf_proxy

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Shelf Proxy 是一个 Dart 包,提供了一个 Shelf 处理程序,用于将 HTTP 请求转发到另一个服务器。它使开发者能够在 Flutter 或 Dart 应用中轻松创建代理服务器,通过最少的配置实现请求拦截和转发。适用于后端集成、API 网关模式或测试环境,支持所有主要平台,包括移动、Web 和桌面。该包与 Shelf 生态系统无缝集成,灵活处理传入请求,并将其路由到外部服务。

适合场景

  • API 网关实现
  • 测试和开发代理
  • 后端服务集成
  • 请求日志记录与监控
  • 跨源请求转发

主要特点

  • 与 Shelf 的简单集成
  • 支持所有 Dart 平台
  • 可配置的目标 URL
  • 透明的请求/响应转发
  • 可扩展的中间件兼容性

适合对象

  • 使用 Shelf 的后端开发人员
  • 需要代理逻辑的全栈Flutter应用
  • 需要请求路由的开发/测试环境
  • 微服务通信设置
  • API 模拟和调试

使用建议

  • 需要对下游故障进行适当的错误处理
  • 可能会根据目标服务器引入延迟
  • 需要安全配置才能用于生产环境
  • 有限的内置身份验证机制
  • CORS 策略必须由外部管理

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Build Status

About Shelf

Shelf makes it easy to create and compose web servers and parts of web servers. How?

  • Expose a small set of simple types.
  • Map server logic into a simple function: a single argument for the request, the response is the return value.
  • Trivially mix and match synchronous and asynchronous processing.
  • Flexibility to return a simple string or a byte stream with the same model.

It was inspired by Connect for NodeJS and Rack for Ruby.

See the package:shelf readme for more information.

Packages

Package Description Issues Version
shelf A model for web server middleware that encourages composition and easy reuse. issues pub package
shelf_packages_handler A shelf handler for serving a packages/ directory. issues pub package
shelf_proxy A shelf handler for proxying HTTP requests to another server. issues pub package
shelf_router A convenient request router for the shelf web-framework, with support for URL-parameters, nested routers and routers generated from source annotations. issues pub package
shelf_router_generator A package:build-compatible builder for generating request routers for the shelf web-framework based on source annotations. issues pub package
shelf_static Static file server support for the shelf package and ecosystem. issues pub package
shelf_test_handler A Shelf handler that makes it easy to test HTTP interactions. issues pub package
shelf_web_socket A shelf handler that wires up a listener for every connection. issues pub package
_shelf_compliance HTTP/1.1 compliance and hardening tests. issues (not published)

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目