[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Web server MIME types / content types


On Fri, May 29, 2015 at 9:01 AM, Andrew Stuart
<andrew.stuart@xxxxxxxxxxxxxxxxxx> wrote:
> Hi Len,
> Thanks for the reply. :-)
> I hope Iâm not coming across as too negative if I suggest that without the 
> correct content type for HTML files the Mirageos unikernel web server serving 
> static files is effectively broken for real world application. Sorry that 
> sounds a bit harsh written in an email.

No worries.  Understand that there is not a "mirage web server" per se
-- Cohttp implements HTTP transport, and
mirage-skeleton/static_website is a minimal example of wiring Cohttp
together with a KV_RO content source.  It's a long way from nginx ;)

However, I agree that static_website example could be better in this
regard, so: https://github.com/mirage/mirage-skeleton/pull/87

> For example if you go to and click on the âLooking for 
> Larry and Sergeyâ link, in Chrome it returns an error.  It should display 
> fine since itâs just a plain HTML page - the primary use case of web serving.
> I do appreciate the directions to how to implement content type thank you, 
> but at this stage was hoping more just to build and use the Mirageos 
> unikernel for serving static websites.
> Do you know if there is there an alternative OCaml web server that can run in 
> a Mirageos unikernel, bake in the static files and serve them with 
> content-type?

It looks like mirage-seal is going in this direction, with the caveats
that a) it's a testbed for TLS support, and b) it does not send
content-type yet.  My impression is that other folks start with
static_website and hack it as needed to serve their purpose, ex. [1]
[2] [3].

I think there is an opportunity for a library that fills in some of
the missing content-serving features, like mime types, cache awareness
(conditional GET), and compression, while staying within the bounds of
Mirage compatibility.  It might take some inspiration from Ocsigen [4]
and Go's net/http [5], and would complement the "static website
generator" pioneer project [6].

[1] http://somerandomidiot.com/blog/2014/08/19/i-am-unikernel/
[2] http://is-awesome.net/2014/11/building-a-blog-with-mirage-os/
[3] http://amirchaudhry.com/from-jekyll-to-unikernel-in-fifty-lines/
[4] http://ocsigen.org
[5] http://golang.org/pkg/net/http


MirageOS-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.