jaguar_dev_proxy 2.1.1

  • Installing
  • Versions
  • 71


Provides PrefixedProxyServer to reverse proxy certain selected requests to another server.

This is similar to Nginx's reverse proxy.


An instance of PrefixedProxyServer has to be created and added to a Jaguar server. The constructor of PrefixedProxyServer takes all the necessary parameters to configure the reverse proxy.

The job of the reverse proxy is to

  1. Match certain paths
  2. Transform it to a target path
  3. Forward the received request to the target path
  4. Forward the response obtained from server to the client

Step 1 and 2 requires configuration.

The matched path

The first parameter (path) to the constructor is used to match the incoming URL/route. The matching is based on prefix. For example:

When path is /html, it will match:

  • /html
  • /html/
  • /html/index.html
  • /html/static/index.html

Target path

The second parameter (proxyBaseUrl) is used to transform the incoming request URL to reverse proxy target URL. The proxyBaseUrl is just prefixed to the remaining part after path is matched match. For example:

For new PrefixedProxyServer('/html', 'http://localhost:8000/client'),

  • /html is mapped into http://localhost:8000/client/
  • /html/ is mapped into http://localhost:8000/client/
  • /html/index.html is mapped into http://localhost:8000/client/index.html
  • /html/static/index.html is mapped into http://localhost:8000/client/static/index.html


The boilerplate example to showcasing reverse proxy capabilities of Jaguar can be found at Reverse proxy example.

Simple example

A simple usage example:

import 'package:jaguar/jaguar.dart';
import 'package:jaguar_dev_proxy/jaguar_dev_proxy.dart';

main() async {
  // Proxy all html client requests to pub server
  // NOTE: Run pub server on port 8000 using command
  //     pub serve --port 8000
  final proxy = new PrefixedProxyServer('/client', 'http://localhost:8000/');

  final server = new Jaguar(address: 'localhost', port: 8085);
  server.getJson('/api/user', (Context ctx) => {'name': 'teja'});
  server.get('/client/version', (Context ctx) => '0.1');
  await server.serve();



  • Added docs
  • Updated README


  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  jaguar_dev_proxy: "^2.1.1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:jaguar_dev_proxy/jaguar_dev_proxy.dart';
Version Uploaded Documentation Archive
2.1.1 May 20, 2018 Go to the documentation of jaguar_dev_proxy 2.1.1 Download jaguar_dev_proxy 2.1.1 archive
1.3.1 Feb 2, 2018 Go to the documentation of jaguar_dev_proxy 1.3.1 Download jaguar_dev_proxy 1.3.1 archive
1.2.6 Jan 13, 2018 Go to the documentation of jaguar_dev_proxy 1.2.6 Download jaguar_dev_proxy 1.2.6 archive
1.1.5 Jan 11, 2018 Go to the documentation of jaguar_dev_proxy 1.1.5 Download jaguar_dev_proxy 1.1.5 archive
0.0.6 Dec 20, 2017 Go to the documentation of jaguar_dev_proxy 0.0.6 Download jaguar_dev_proxy 0.0.6 archive
0.0.5 Jul 10, 2017 Go to the documentation of jaguar_dev_proxy 0.0.5 Download jaguar_dev_proxy 0.0.5 archive
0.0.4 Jun 7, 2017 Go to the documentation of jaguar_dev_proxy 0.0.4 Download jaguar_dev_proxy 0.0.4 archive
0.0.3 Feb 19, 2017 Go to the documentation of jaguar_dev_proxy 0.0.3 Download jaguar_dev_proxy 0.0.3 archive
0.0.2 Feb 7, 2017 Go to the documentation of jaguar_dev_proxy 0.0.2 Download jaguar_dev_proxy 0.0.2 archive
0.0.1 Feb 7, 2017 Go to the documentation of jaguar_dev_proxy 0.0.1 Download jaguar_dev_proxy 0.0.1 archive


We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
46 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
90 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:jaguar_dev_proxy/jaguar_dev_proxy.dart with components: io.


  • Homepage does not exists.

    We were unable to access at the time of the analysis.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use jaguar_dev_proxy.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <2.0.0
jaguar ^2.1.1 2.1.7
path >=0.9.0 <2.0.0 1.6.0
Transitive dependencies
auth_header 0.0.3
charcode 1.1.1
collection 1.14.10
convert 2.0.1
crypto 2.0.3
http_server 0.9.7
logging 0.11.3+1
meta 1.1.5
mime 0.9.6+1
stack_trace 1.9.2
typed_data 1.1.5
Dev dependencies
build_runner ^0.7.0
build_web_compilers ^0.2.0
test >=0.12.0 <0.13.0