Simple HTTP server application for Windows that can be launched on-demand?
Asked Answered
S

3

7

I need a simple HTTP server application that meets the following criteria:

  1. It must run on Windows.
  2. It must NOT require new Windows installations of any sort: programs, frameworks, services, etc.
  3. It can be run with Java (e.g. JARs) or .NET as those frameworks are already installed globally on the servers.
  4. It must be able to be started and stopped by an Ant build (and/or from command line) on demand.
  5. It must be able to host on a port specified at runtime (i.e. not in a config file).
  6. It must only be able to host basic static content (JavaScript, CSS, Images, HTML) from a root directory specified at runtime (i.e. not in a config file).
  7. Must not require a huge distribution folder, e.g. the full Jetty distribution is approximately 40 MB... way too big! Under 1 MB would be preferred.
  8. It does NOT need to support HTTPS (SSL).
  9. It does NOT need to integrate with any IDEs.
  10. It does NOT need to host any "web applications", e.g. EARs, WARs, JARs, etc.

Any recommendations? I will also need a guide/tutorial explanation for setting them up, especially if they are Java-based as I have very little background in Java (and honestly not that much background in Ant, either).

Thanks!

Sensory answered 11/5, 2012 at 16:57 Comment(4)
Regarding Jetty, if it's just for static content, you should be able to remove a number of jars (more so if you're willing to embed Jetty within your small application to do this).Principle
Might find more information in this question #5051351Brody
@Principle Care to comment further on my other question? #10556368Sensory
@Hexxagonal: I did see that one, though most don't meet my requirements either due to needing installation or not being dynamically configurable. There are a few valid candidates there, though.Sensory
F
4

I would recomment onehttpd - https://code.google.com/p/onehttpd/

It's one 62.5K executable. You can run it as easy as onehttpd.exe -p 80 c:\var\www.

Fatherly answered 23/2, 2015 at 14:15 Comment(0)
M
1

Here are some lightweight web servers that appear to work on Windows and have minimal dependencies:

Resin: http://www.caucho.com/resin-web-server/ <-- Requires java

Hiawatha: http://www.hiawatha-webserver.org/

Cherokee: http://www.cherokee-project.com/doc/

Maneuver answered 11/5, 2012 at 18:14 Comment(0)
C
1

If you need a very light HTTP server, you can use NanoHTTPD. It is distributed as a tiny Jar (an unique class if I recall well).

Also, it is very easy to modify according to your needs (and BSD licensed).

http://elonen.iki.fi/code/nanohttpd/

Coffman answered 13/2, 2013 at 21:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.