Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agilord/http_request_proxy
Proxy HTTP requests to other server (typically from Dart backend to pub serve during development).
https://github.com/agilord/http_request_proxy
Last synced: 2 months ago
JSON representation
Proxy HTTP requests to other server (typically from Dart backend to pub serve during development).
- Host: GitHub
- URL: https://github.com/agilord/http_request_proxy
- Owner: agilord
- License: bsd-3-clause
- Created: 2016-11-05T22:58:27.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-12T15:28:08.000Z (about 8 years ago)
- Last Synced: 2024-03-25T21:33:19.164Z (10 months ago)
- Language: Dart
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HTTP request proxy
Proxy HTTP requests to other server
(typically from Dart backend to pub serve during development).## Usage
A simple usage example:
import 'dart:io';
import 'package:http_request_proxy/http_request_proxy.dart';main() {
var proxy = new HttpRequestProxy('localhost', 8000);
HttpServer server = await HttpServer.bind(InternetAddress.ANY_IP_V4, 3333);
server.listen((request) {
if (request.uri.path.startsWith('/api/')) {
// handle API call
} else {
// proxy to local pub serve
proxy.proxyHttpRequest(request);
}
});
}## Links
- [source code][source]
- contributors: [Agilord][agilord][source]: https://github.com/agilord/http_request_proxy
[agilord]: https://www.agilord.com/