This single Java source file is a full-fledged HTTP 0.9 server. I wanted to add it to expose the console lock bug (fixed in a separate patch), and to verify that bind() works correctly (it does).
But additionally, this tiny HTTP server (about 6KB of compressed bytecode) can be very useful for our CLI - it can be run in the background and let you view files in the OSV system in your browser, even while another program is running.
To run Shrew from the CLI, just run
java com.cloudius.cli.util.Shrew
Which runs the HTTP server in the background (in a separate thread), letting the user continue to use the CLI. If you add an argument "fg" to this command, it runs the server in the current thread, never returning.
Currently, the HTTP server is written to browse OSV's root directory hierarchy: accessing http://192.168.122.100:8080/ from the host shows you the OSV guest's root directory, and you can decend into more directories and download individual files.
948bea4 CLI: add tiny HTTP server
java/cli/com/cloudius/cli/util/Shrew.java | 677 +++++++++++++++++++++++++++++
1 file changed, 677 insertions(+)
Upstream: github.com