搜尋套件、儲存庫與 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 的後端開發人員
  • 需要代理邏輯的全 stack 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 項

原始碼儲存庫

使用此套件的專案