Coder Social home page Coder Social logo

Resume capability for HTTP GET about tusd HOT 5 CLOSED

tus avatar tus commented on July 18, 2024
Resume capability for HTTP GET

from tusd.

Comments (5)

Acconut avatar Acconut commented on July 18, 2024

Even if downloading content is not the scope of the tus protocol, I do see the reasons for why the tusd should server should support range requests. Luckily, Golang includes a convenient function for serving content over HTTP (https://golang.org/pkg/net/http/#ServeContent) which also respects the Range header.
Unfortunately, due to it's argument types, this method may only be useful if you are using a disk-based storage (the stream needs to support seeking which is only efficient for disk-based storages in our case). Considering this limitation, would you still benefit from this feature addition?

from tusd.

Arman92 avatar Arman92 commented on July 18, 2024

I don't understand what you mean of "Disk-based storage", what other options for file storage do you have in mind?

from tusd.

Acconut avatar Acconut commented on July 18, 2024

I agree that my description was not accurate enough. What I meant was local disk-based storage where the tus server writes the uploads directly to a local disk (in theory, it could also be a mounted network file system; the server just needs to be able to access the files using standard file system methods). The opposite of this would be storing the uploads on a remote server, e.g. AWS S3 or any other cloud provider. The difference is that in latter case you do not have direct access to the files but instead needs to use their provided API.

from tusd.

Arman92 avatar Arman92 commented on July 18, 2024

Yes I understand, we intend to use our own storage for file saving, if you suggest to use another http server, say Apache, how do we know the remote file URL in clients? would it be sufficient to just convert the resolved url (the url that tus gives when starting to upload a file) to something that our http server understands?

from tusd.

Acconut avatar Acconut commented on July 18, 2024

If you want to run a proxy in front of a tusd server, be sure to add the -behind-proxy flag to the command line (or use RespectForwardedHeaders in https://godoc.org/github.com/tus/tusd#Config if you use the package directly). When enabled and assuming your proxy sends the X-Forwarded-* or Forwarded headers, the URL returned after creating an upload will automatically use the host, port and protocol from the proxy. In most cases, this should be enough to run tusd behind Apache, Nginx etc. You don't have to do any URL conversion manually.

from tusd.

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.