Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

int128/instahttp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InstaHttp Build Status

InstaHttp is an instant Web server based on Jetty.

It provides HTTP access to static content in the local filesystem.

How to Use

Run the server

Download the release and run. It requires Java 6 or later.

java -jar instahttp.jar

Open http://localhost:8080/.

Options

It accepts following options:

  • -b host - listening host; default is -b 0.0.0.0 (all interfaces)
  • -p port - listening port; default is -p 8080
  • -l - listening on localhost
  • Extra argument - a base path of static content; default is . (current directory)

Example:

java -jar instahttp.jar -l ..

How to Use in your App

InstaHttp is available on Maven Central and Bintray.

// Gradle
compile 'org.hidetake:instahttp:x.y'

Create and start a server by calling HttpServer.create() method.

import org.eclipse.jetty.server.Server;
import org.hidetake.httpserver.HttpServer;
import java.net.InetSocketAddress;

Server server = HttpServer.create(new InetSocketAddress(8080), ".");
server.start();

server.stop();

See Main class for example.

Contribution

This is an open source software licensed under the Apache License Version 2.0. Send me your issue or pull request.

About

Instant HTTP server on JavaVM

Resources

Stars

Watchers

Forks

Packages

No packages published