Hallo all.
I'm trying to implement an http static server that supports range requests.
It is almost working, but i'm experiencing EPIPE clientErrors when serving
an mp3 file to iOS devices.
The same doesn't happen with desktop browers (tested on WebKit, Chrome and
FireFox), where everything seems to be working properly.
Since the playback continues with no problem on the device, i'm just
swallowing the exception right now...
After each response, the client throws the error, and the connection is
closed.
Transcript of the relevant http headers:
> GET /test.mp3
host: 192.168.1.105:8080
accept:
application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
accept-language: en-us
accept-encoding: gzip, deflate
connection: keep-alive
< 200
Accept-Ranges: bytes
Content-Length: 130082919
Content-Type: audio/mpeg
Connection: keep-alive
> GET /test.mp3
host: 192.168.1.105:8080
range: bytes=0-1
accept: */*
accept-encoding: identity
connection: keep-alive
< 206
Accept-Ranges: bytes
Content-Length: 2
Content-Range: bytes 0-1/130082919
Content-Type: audio/mpeg
Connection: keep-alive
!http_server.on.clientError { [Error: write EPIPE] code: 'EPIPE', errno:
'EPIPE', syscall: 'write' }
!http_server.on.request
> GET /test.mp3
host: 192.168.1.105:8080
range: bytes=0-130082918
accept: */*
accept-encoding: identity
connection: keep-alive
< 206
Content-Length: 130082919
Content-Range: bytes 0-130082918/130082919
Content-Type: audio/mpeg
Connection: keep-alive
!http_server.on.clientError { [Error: write EPIPE] code: 'EPIPE', errno:
'EPIPE', syscall: 'write' }
!http_server.on.connection
And so on...
I'm also not sure if i should send the Accept-Ranges header field for every
206 response following the initial request or not.
On the node side, i'm just parsing the range header, and streaming the file
using fs.createReadStream, passing the options to define the range of bytes
to be read.
What am I doing wrong? Or maybe is the normal behaviour on iOS?
Thanks in advance.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en