NSURLSession fails with multipart/x-mixed-replace

iOS9 stop receiving such streams after a few secs.

Filed bug 22595420

Hi dwery,


I have same issue with you.

Do you have some suggestion ?

Yes: please prepare a demo project and file a bug report 🙂

Have you other solution to fix it ?


Send to Apple Bug Report ?

As the leading `x-` is suggesting, multipart/x-mixed-replace is not a standardized mime type, which some browsers does not support. You can send a Feature Request to Apple, but I don't think Apple would soon take it into the functionality of NSURLSession. You better find another solution, which does not depend on a non-standardized feature.

De facto multipart/x-mixed-replace for Motion JPEG.

If not support multipart/x-mixed-replace, then multiple app to use Motion JPEG will be dropped ?

As I wrote, it's not so common to be called as `De facto`. It may be an option you can choose that you send a Feature Request to Apple and wait (possibly forever) till Apple would accept it.

I guess you haven't read the docs, because IT IS supported by Apple, documented in the class and actually worked nicely

up to iOS 8.x .

Sorry, frankly, I was completely missing some of the class reference clearly referring `multipart/x-mixed-replace`. My opinion about supporting `multipart/x-mixed-replace` should be another thing, and we should discuss the functionality based on the official documentations. Apple should support it with those documentations once made public. Sorry again, and hoping your issue fixed soon.

We have similair problems, but not with all mjpeg streams. Some work, while other do not. On iOS 8 and lower, they all work.

There is a small difference in the HTTP connection headers:

Still working on iOS 9:


HTTP/1.0 200 OK

Cache-Control: no-cache

Pragma: no-cache

Expires: Thu, 01 Dec 1994 16:00:00 GMT

Connection: close

Content-Type: multipart/x-mixed-replace; boundary=myboundary

--myboundary

Content-Type: image/jpeg

Content-Length: 52308


DATADATADATA


Not working on iOS 9 (but works on iOS 8):


HTTP/1.1 200 OK

Content-Type: multipart/x-mixed-replace;boundary=---nessy2jpegboundary

-----nessy2jpegboundary

Content-Type: image/jpeg

Content-Length: 52039


DATADATADATA

Please open a bug too so we might have some chances to have this bug properly fixed. Thanks!

NSURLSession fails with multipart/x-mixed-replace
 
 
Q