Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 

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

About

Proxy HTTP requests to other server (typically from Dart backend to pub serve during development).

Resources

License

Releases

No releases published

Packages

No packages published

Languages