Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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).

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/