dhttpd 2.0.0

  • README.md
  • Installing
  • Versions
  • 54

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.

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 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 Mar 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.31.0
  • pana: 0.10.3


Describes how popular the package is relative to other packages. [more]
9 / 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.1
shelf ^0.7.2 0.7.2
shelf_static ^0.2.0 0.2.7
Transitive dependencies
async 2.0.6
charcode 1.1.1
collection 1.14.5
convert 2.0.1
http_parser 3.1.1
mime 0.9.6
path 1.5.1
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.4
string_scanner 1.0.2
typed_data 1.1.5