dhttpd 2.0.0

  • README.md
  • Installing
  • Versions
  • 65

Build Status

A simple HTTP server that can serve up any directory, built with Dart. Inspired by python -m SimpleHTTPServer.


Use the pub global command to install this into your system.

$ pub global activate dhttpd


If you have modified your PATH, you can run this server from any local directory.

$ dhttpd

Otherwise you can use the pub global command.

$ pub global run dhttpd

Here's an example of creating a web app with Stagehand and then running it with this server:

$ stagehand web-angular
$ pub get
$ pub build
$ dhttpd --path build/web/  # Serves app at http://localhost:8080


  • --port - Set the port. Defaults to 8080.
  • --path - Set the path to serve. Defaults to cwd.
  • --host - Hostname to listen on. Defaults to localhost.


  • Removed allow-origin flag. In reality, this flag never worked because the shelf pipeline was not configured correctly.

  • Source moved to github.com/kevmoo/dhttpd.


  • No change in functionality, just version and doc tweaks.


  • Fixed bug with setting the path from the command line.
  • Start the server with dhttpd.


  • New host command-line flag, to set the hostname to listen on. Defaults to localhost


  • New allow-origin command-line flag for CORS headers. Thanks to @gmosx for the patch.

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate dhttpd

2. Use it

The package has the following executables:

$ dhttpd

Use this package as a library

1. Depend on it

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

  dhttpd: "^2.0.0"

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:dhttpd/dhttpd.dart';
Version Uploaded Documentation Archive
2.0.0 Mar 5, 2018 Go to the documentation of dhttpd 2.0.0 Download dhttpd 2.0.0 archive
0.3.1 Sep 20, 2015 Go to the documentation of dhttpd 0.3.1 Download dhttpd 0.3.1 archive


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

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


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


Detected platforms: Flutter, other

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


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

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dhttpd.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
args >=0.12.0+1 <2.0.0 1.4.3
shelf ^0.7.2 0.7.3+2
shelf_static ^0.2.0 0.2.8
Transitive dependencies
async 2.0.7
charcode 1.1.2
collection 1.14.10
convert 2.0.1
http_parser 3.1.2
mime 0.9.6+1
path 1.6.1
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.7+1
string_scanner 1.0.2
typed_data 1.1.5