Skip to content

Instantly share code, notes, and snippets.

ncorona ncorona

Block or report user

Report or block ncorona

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
padenot / stream.js
Created Oct 29, 2011
How to serve media on node.js
View stream.js
var http = require('http');
var path = require('path');
var fs = require('fs');
var AUDIOFILE = "./audio.ogg";
function serveWithRanges(request, response, content) {
var range = request.headers.range;
var total = content.length;
var parts = range.replace(/bytes=/, "").split("-");
You can’t perform that action at this time.