{"action":"created","issue":{"url":"https://api.github.com/repos/mafintosh/peerflix/issues/207","labels_url":"https://api.github.com/repos/mafintosh/peerflix/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/mafintosh/peerflix/issues/207/comments","events_url":"https://api.github.com/repos/mafintosh/peerflix/issues/207/events","html_url":"https://github.com/mafintosh/peerflix/issues/207","id":84149193,"number":207,"title":"Ability to specify a transform stream in the options","user":{"login":"ngryman","id":892048,"avatar_url":"https://avatars.githubusercontent.com/u/892048?v=3","gravatar_id":"","url":"https://api.github.com/users/ngryman","html_url":"https://github.com/ngryman","followers_url":"https://api.github.com/users/ngryman/followers","following_url":"https://api.github.com/users/ngryman/following{/other_user}","gists_url":"https://api.github.com/users/ngryman/gists{/gist_id}","starred_url":"https://api.github.com/users/ngryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngryman/subscriptions","organizations_url":"https://api.github.com/users/ngryman/orgs","repos_url":"https://api.github.com/users/ngryman/repos","events_url":"https://api.github.com/users/ngryman/events{/privacy}","received_events_url":"https://api.github.com/users/ngryman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-02T18:43:13Z","updated_at":"2015-11-27T09:04:53Z","closed_at":null,"body":"Hi,\r\n\r\nIt would be awesome to be able to specify one or several transform streams int the options, in order to be able to intercept data before it is sent on the network. A typical use case would be to transcode data on-the-fly, taking advantage of your builtin server.\r\n\r\nHere is pseudo code to illustrate:\r\n\r\n```javascript\r\n/** User land */\r\n\r\nvar transcoder = new TranscoderStream()\r\npeerflix(torrent.info, {\r\n  transform: [transcoder]\r\n})\r\n\r\n/** Peerflix land */\r\n\r\n// ...\r\nvar streams = opts.transfoms.slice(0)\r\nstreams.unshift(file.createReadStream())\r\nstreams.push(response)\r\n\r\npump.apply(null, streams)\r\n// ...\r\n\r\n```\r\n\r\nThis could help Popcorn Time to resolve this issue quite easily: https://git.popcorntime.io/popcorntime/desktop/issues/475."},"comment":{"url":"https://api.github.com/repos/mafintosh/peerflix/issues/comments/160078844","html_url":"https://github.com/mafintosh/peerflix/issues/207#issuecomment-160078844","issue_url":"https://api.github.com/repos/mafintosh/peerflix/issues/207","id":160078844,"user":{"login":"ngryman","id":892048,"avatar_url":"https://avatars.githubusercontent.com/u/892048?v=3","gravatar_id":"","url":"https://api.github.com/users/ngryman","html_url":"https://github.com/ngryman","followers_url":"https://api.github.com/users/ngryman/followers","following_url":"https://api.github.com/users/ngryman/following{/other_user}","gists_url":"https://api.github.com/users/ngryman/gists{/gist_id}","starred_url":"https://api.github.com/users/ngryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngryman/subscriptions","organizations_url":"https://api.github.com/users/ngryman/orgs","repos_url":"https://api.github.com/users/ngryman/repos","events_url":"https://api.github.com/users/ngryman/events{/privacy}","received_events_url":"https://api.github.com/users/ngryman/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T09:04:53Z","updated_at":"2015-11-27T09:04:53Z","body":"@monst6 I don't remember exactly, but I think I ended up forking `peerflix` and using my patched version (which is provided above)."}}