Live data from Hacker News

Tus.io: Open Protocol for Resumable File Uploads

tus.io

11–20 of 32 posts

Re: Tus.io: Open Protocol for Resumable File Uploads

#13

Resumable file transfers in JS is really cool. But why a totally new protocol? Why not use bittorrent, rsync, or even ftp? A lot of effort has gone into making those reliable in the face of network congestion. Trying to shove a lot of bits down a single TCP connection with no traffic shaping is just asking for bufferbloat to strike.

rsync was the first thing that came to my mind as well. You can even use it for entire directories of stuff.

Re: Tus.io: Open Protocol for Resumable File Uploads

#15

Resumable file transfers in JS is really cool. But why a totally new protocol? Why not use bittorrent, rsync, or even ftp? A lot of effort has gone into making those reliable in the face of network congestion. Trying to shove a lot of bits down a single TCP connection with no traffic shaping is just asking for bufferbloat to strike.

Because these protocols are unusable from the perspective of JS on a webpage in a browser. Yes, browsers do support FTP, but I don't believe there are any browsers that support FTP uploads (and even if there are any, I doubt it'd be possible to upload from JS).

HTTP also has the advantage of being allowed through virtually every firewall.

It seems that webapps are paving the way of the future, for better or worse.

Re: Tus.io: Open Protocol for Resumable File Uploads

#16

Resumable file transfers in JS is really cool. But why a totally new protocol? Why not use bittorrent, rsync, or even ftp? A lot of effort has gone into making those reliable in the face of network congestion. Trying to shove a lot of bits down a single TCP connection with no traffic shaping is just asking for bufferbloat to strike.

[deleted]

Re: Tus.io: Open Protocol for Resumable File Uploads

#18
post #2

Out of curiosity why did you decide to use NSURLConnection instead of NSURLSession? I recall NSURLSession also had some code related to resume functionality for both uploads and downloads but my memory is a bit foggy right now.

Particularly since NSURLConnection is deprecated in the current SDK. NSURLSession has been available since IOS 7.

While NSURLSession does support resumable downloads, it isn't able to resume uploads.

The needNewBodyStream: delegate is the closest thing, and that is called when first uploading from an NSInoutStream or when a transmission error occurs for an idempotent request, or an auth challenge occurs when some of the stream has been sent. (Streams cannot be rewound.)

Background NSURLSessions can take a file reference to upload, and ideally will perform the upload "at a good time", hopefully while charging and connected to a stable network. (But it won't resume an upload, just retry if possible.)

Disclaimer: I'm "involved", but not speaking for any parties involved. Mostly because I don't get invited to those sorts of parties.

Re: Tus.io: Open Protocol for Resumable File Uploads

#19

Do you have to use the tus server written in go ( https://github.com/tus/tusd )? Possible to use a node.js backend?

You could implement the protocol in node.js. Here's the standards document: https://github.com/tus/tus-resumable-upload-protocol/blob/ma...

edit: Looks like someone's already done that: https://github.com/vayam/brewtus (found on http://tus.io/implementations.html, which also has links to Ruby, PHP and CoffeeScript server implementations, and Qt C++, PHP, Go, and Python clients)

Re: Tus.io: Open Protocol for Resumable File Uploads

#20

Resumable file transfers in JS is really cool. But why a totally new protocol? Why not use bittorrent, rsync, or even ftp? A lot of effort has gone into making those reliable in the face of network congestion. Trying to shove a lot of bits down a single TCP connection with no traffic shaping is just asking for bufferbloat to strike.

[deleted]
Post reply on HN