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

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

On 30 May 2015, at 21:02, Matthew Gray <matthew.thomas.gray@xxxxxxxxx> wrote:
> On Fri, May 29, 2015 at 9:43 PM, Thomas Gazagnaire <thomas@xxxxxxxxxxxxxx> 
> wrote:
> > 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.
> Thanks for noticing, I've created 
> https://github.com/mirage/mirage-seal/issues/4 to track that. Patches are 
> welcome :-)
> Here's a patch https://github.com/mirage/mirage-seal/pull/7,  - I more or 
> less lifted it verbatim from Len's patch... :)
> I see mirage-seal as a default way to publish static contents with mirage in 
> the near future. I plan to add a mode to serve HTTP contents only (but yes, 
> currently the goal is to test the other libraries).
> I could definitely use HTTP-only, I'll have a look at doing that next.

The overall issue here is that we need a better place to put in default 
webserving logic that is sensible for real-world page serving instead of just 
raw HTTP.  Right now we have a few libraries in this stack:

- Cohttp (the low level HTTP protocol)
- Mirage-HTTP (the application of Cohttp to the Mirage networking stack)
- Mirage-skeleton (sample basic applications)
- Opium (a request routing web framework)
- Mirage-Seal (a convenient CLI frontend to configuring static web apps)

Mirage-Skeleton is being used right now (as Andrew did) to experiment with 
simple web applications, but shouldn't be the place where logic such as MIME 
detection is stored, as this should go into a library.  Similarly, Mirage-Seal 
shouldn't have all this either, since it's a thin CLI layer that configures 

The right place ultimately for the MIME detection logic is either in 
Mirage-HTTP, which does very little at the moment aside from combine the CoHTTP 
and Mirage-TCP functors. The other possible place is Opium; I really enjoyed 
using Opium as a user for my own website, and so am keen to see that progress. 

(while this structuring of libraries may seem painful now, it's really 
worthwhile in the longer term for maintainability!)


MirageOS-devel mailing list



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