# HG changeset patch # User Maxim Dounin # Date 1215135338 -14400 # Node ID 91985471307e5b6a8f6971407194b81c04b114ae # Parent be5e612dd6026423d03f675cbd273258509de9c6 Add license and some minimal documentation. diff --git a/LICENSE b/LICENSE new file mode 100644 --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2008 Maxim Dounin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ diff --git a/README b/README new file mode 100644 --- /dev/null +++ b/README @@ -0,0 +1,28 @@ +Bytes module for nginx. + +This module was designed to allow easy access to range of file data. It +searches request arguments for 'bytes=...' and return requested range. All +requested data is returned concatinated in single reply, with apropriate +Content-Length set. + +All of the above allows to do nasty things with regular files and even +proxied replies, including things like flv streaming. E.g. one may use +something like this instead of flv module: + + location /video/ { + bytes on; + if ($args ~ "start=(\d+)") { + set $args "bytes=0-12,$1-"; + } + } + +Argument bytes= must contain range specification as defined in RFC 2616, +"14.35.1 Byte Ranges", with the following exceptions: + + 1. Whitespaces aren't permitted. + + 1. Ranges must not overlap and must be monothonic. E.g. something + like "bytes=10-20,0-10" isn't premitted. + +To compile nginx with bytes module, use "--add-module " option to nginx +configure.