ironsmile / nedomi

Highly performant HTTP reverse proxy with efficient caching of big files
GNU General Public License v3.0
81 stars 9 forks source link

make it possible for sendfile to be used #169

Closed mstoykov closed 8 years ago

mstoykov commented 8 years ago

there a lot of changes to many of the io.Writer/io.Reader implementations. All of them are more or less so that an io.Copy with a io.Reader being *os.File and an io.Writer of net.Conn could be called at some point.

Currently this is not possible with the throttle handler - which will be implemented at a later time.

The same is true for the mp4 handler when a start parameter is provided. This will be harder to fix and will need another change to the github.com/MStoykov/mp4 library.

The flv handler was not tested.

The usage of sendfile ofcourse does not work if used on operating system with no sendfile syscall or an alternative. Also it's only possible to be done with os.File, so only disk cached or static content can be sent.