Giter VIP home page Giter VIP logo

Comments (15)

ohookins avatar ohookins commented on April 28, 2024

The version I'm running appears to be happy with the range header, but does not correctly serve partial responses (it will serve the entire file). It would be great if it did ranged responses.

from http-server.

david-risney avatar david-risney commented on April 28, 2024

Supporting range responses would be very nice. I currently can't use http-server to serve up video for HTML video tag scenarios because without range requests browsers have to wait for the entire video resource to be downloaded which depending on the video can be a very long wait before the video starts playing.

from http-server.

tremby avatar tremby commented on April 28, 2024

I'll add my vote for supporting ranges. It's vital for big files -- continuing downloads, for example.

from http-server.

thom4parisot avatar thom4parisot commented on April 28, 2024

Same here :-)

from http-server.

indexzero avatar indexzero commented on April 28, 2024

I'm a total n00b with this header. @oncletom could you rephrase your +1 in the form of a pull-request?

from http-server.

tremby avatar tremby commented on April 28, 2024

It really isn't complicated. Check out the spec at
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 -- it isn't
long and is very simple.

from http-server.

indexzero avatar indexzero commented on April 28, 2024

@tremby so ... is that your way of saying we should all expect a pull-request from you soon? 😁

from http-server.

thom4parisot avatar thom4parisot commented on April 28, 2024

@indexzero I am like you, I did not much about the behaviour of Range.

The send module is handling all the logic – I suppose implementing it is too much. There is a content-range parser otherwise, and now I discovered the createReadStream accepts a start/end, it makes it quite easy to do.

It is just a matter of writing tests then. I hope I will manage to save some time to propose a PR this week :-)

from http-server.

tremby avatar tremby commented on April 28, 2024

On 16 Sep 2014 07:40, "Charlie Robbins" [email protected] wrote:

@tremby so ... is that your way of saying we should all expect a
pull-request from you soon? 😁

I'm on vacation right now, so no time soon. But it's not out of the
question.

I really would have thought there's some node module out there with a
working implementation which could be leveraged...

from http-server.

indexzero avatar indexzero commented on April 28, 2024

Looks like there is. Could you check this out? https://github.com/jshttp/range-parser

from http-server.

thom4parisot avatar thom4parisot commented on April 28, 2024

So according to pillarjs/send#64, that jshttp effort will most likely extract that bit from the send module (from which ranger-parser has been pulled off already as you can see).

Status is there: https://jshttp.github.io/

An effort is already ongoing, I guess we just have to wait :-)

from http-server.

danvk avatar danvk commented on April 28, 2024

[email protected] does appear to support this:

$ curl 'http://0.0.0.0:8080/file.txt'
Hello World
$ curl -H 'Range: bytes=6-' 'http://0.0.0.0:8080/file.txt'
World
$ curl -D - -H 'Range: bytes=6-' 'http://0.0.0.0:8080/file.txt'
HTTP/1.1 206 Partial Content
server: ecstatic-0.6.0
Content-Range: bytes 6-11/12
Accept-Ranges: bytes
Content-Length: 6
Content-Type: text/plain; charset=UTF-8
Date: Thu, 26 Feb 2015 20:17:32 GMT
Connection: keep-alive

World

from http-server.

pwnall avatar pwnall commented on April 28, 2024

FWIW, this works for me (tested using the commands above), using http-server 0.9.0. I'm fairly sure that this issue can be closed.

from http-server.

abdulhannanali avatar abdulhannanali commented on April 28, 2024

@indexzero Yes! I agree with @pwnall . This issue can be closed, Ecstatic does implement partial range headers, so I guess, there's not a need to do this separately.

from http-server.

tremby avatar tremby commented on April 28, 2024

I just tested myself and ranges seem to be supported correctly with http-server 0.11.1.

from http-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.