[Icecast-dev] How to use http-put for JavaScript source client
"Thomas B. Rücker"
thomas at ruecker.fi
Wed Jul 31 02:10:16 PDT 2013
Hi,
On 07/23/2013 07:44 PM, Jamie McClelland wrote:
> I'm following up on a thread started by Stephen a couple months ago
> about building a JavaScript source client using webrtc.
>
> The first step suggested was to figure out how to mux the audio and
> video. After I posted a feature request on the webrtc experiment js
> library, we seem to have a solution:
> https://github.com/muaz-khan/WebRTC-Experiment/issues/28#issuecomment-20791759
I saw that, I didn't grasp if that provides a proper Ogg muxed stream,
but we'll find out.
> Based on the last comment on the icecast Dec list, we now only need to
> do do an HTTP put request to the icecast server (
> http://lists.xiph.org/pipermail/icecast-dev/2013-May/002171.html).
That's correct. Make sure to use a recent beta version of Icecast 2.4
though!
> Great! I've got my jquery ready, but am having trouble finding docs on
> how to build the put request. I tried looking at the libshout source,
> but my c skills aren't quite good enough to figure it out.
It's even easier, you can even use CURL (that's why we implemented PUT
to provide better interoperability through standard compliance).
> Any help would be appreciated, particularly with an example.
Using my example from http://icecast.org/#release_2.4-beta2 :
cat foo.ogg | curl -u source:hackme -H "Content-type: application/ogg"
-T - http://localhost:8000/mountname.ogg
This is the plain text dump of the HTTP connection:
PUT /mountname.ogg HTTP/1.1
Authorization: Basic c291cmNlOmhhY2ttZQ==
User-Agent: curl/7.31.0
Host: localhost:8000
Accept: */*
Transfer-Encoding: chunked
Content-type: application/ogg
Expect: 100-continue
Then the server acknowledges and raw data follows.
Note that there's still a 100-continue patch not landed, so we're not
100% compliant yet. Usually things shouldn't break though.
Hope that helps.
Cheers
Thomas
More information about the Icecast-dev
mailing list