Open mo-g opened 1 year ago
Problem appears to be in client.js inside the "if metaint" block. This is debug with it:
icy:client request "socket" event +0ms
icy:client request "response" event +1s
icy:client got metaint: 16000 +0ms
icy:client proxying "socket" +4ms
icy:client proxying "httpVersionMajor" +1ms
icy:client proxying "httpVersionMinor" +0ms
icy:client proxying "httpVersion" +0ms
icy:client proxying "complete" +1ms
icy:client proxying "rawHeaders" +0ms
icy:client proxying "rawTrailers" +0ms
icy:client proxying "aborted" +0ms
icy:client proxying "upgrade" +1ms
icy:client proxying "url" +0ms
icy:client proxying "method" +0ms
icy:client proxying "statusCode" +1ms
icy:client proxying "statusMessage" +0ms
icy:client proxying "client" +0ms
icy:client proxying "req" +0ms
icy:client proxying "responseUrl" +0ms
icy:client proxying "redirects" +0ms
Note that headers are not being proxied, for some reason. If you comment it out, audio plays for the first 16000 samples, then gets crashed by the metadata arriving.
So this is two separate problems.
First is the headers not being proxied on metaint streams. I've fixed that on my fork. The crashing is actually kind of unrelated - I was using some slightly more complex stream pipes than in the example, and it was the pipes collapsing when the speed of delivery changed. I'm going to look into fixing this in my application by buffering the response before piping it.
Sample: https://radio.dripfeed.net/listen/monstromental/radio.mp3
Also: https://stream.camfm.co.uk/camfm
But rawHeaders exist for these streams:
The application/ogg stream I've been testing against works fine, it's specifically audio/mpeg streams that fail.