shelf_proxy
1.0.5, released 7 months ago by tools.dart.dev
A shelf handler for proxying HTTP requests to another server.
What it does
Provides a Shelf handler that proxies incoming HTTP requests to an external server. It can be served directly as a standalone proxy server or mounted within a larger Shelf application to proxy specific URLs.
AI-written summary of version 1.0.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a backend server using Shelf and need to proxy requests to an external server.
- You want to mount a proxy handler for specific URLs within a larger Shelf application.
Skip it when
- You are not using Shelf for your backend routing.
- You need a full-featured API gateway with complex routing rules and transformation capabilities beyond simple proxying.
Strengths
- Integrates seamlessly with the Shelf ecosystem.
- Can be used standalone or mounted within larger applications.
- Correctly handles multiple Cookie and Set-Cookie headers.
Weaknesses
- Limited to Shelf-based applications.
- Basic proxying capabilities without advanced middleware features built-in.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
not documented
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_proxy/shelf_proxy.dart';
void main() async {
var server = await shelf_io.serve(
proxyHandler("https://dart.dev"),
'localhost',
8080,
);
print('Proxying at http://${server.address.host}:${server.port}');
}Alternatives
Packages that do the same job and could replace shelf_proxy.
- relic_io
dart:io adapter for Relic web server.
81Compare - firebase_performance
Flutter plugin for Google Performance Monitoring for Firebase.
91Compare - bones_api
A powerful API backend framework for Dart with HTTP server, routing, SQL translator, and DB adapters.
75Compare - dart_frog_cli
Official command-line interface for the Dart Frog backend framework.
86Compare
Works with
Packages commonly used together with shelf_proxy: ones it builds on, ones built on it, and its own family.
- shelfshelf_proxy depends on itComposable web server middleware for Dart
- shelf_staticSame familyServe static files over HTTP with the shelf package
- shelf_web_socketSame familyShelf handler that upgrades HTTP to WebSocket and provides a WebSocketChannel per connection.
- shelf_packages_handlerSame familyShelf handler that serves a `packages/` directory of Dart package assets.
- sseSame familyBidirectional Server Sent Events client and server for Dart.
- build_runnerSame familyA build system for Dart code generation and modular compilation.
- build_daemonSame familyDaemon for running Dart builds in the background
- shelf_routerSame familyA request router for the shelf web-framework with support for URL parameters and nested routers.