InstaHttp is an instant Web server based on Jetty.
It provides HTTP access to static content in the local filesystem.
Download the release and run. It requires Java 6 or later.
java -jar instahttp.jar
Open http://localhost:8080/
.
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 ..
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.
This is an open source software licensed under the Apache License Version 2.0. Send me your issue or pull request.