# [SOLVED] IPhone Resets Communication from Server



## danabaillie (May 6, 2014)

I have a simple html file to open an mp4 (h.264) file. When the file sits on a Windows IIS server, my IPhone and IPad will play the video without any issues.

When the file sits on a proprietary server, my IPhone and IPad request the download, but then stops the process almost immediately. Non IOS phones and desktop browsers have no problems requesting and viewing the video from the proprietary server.

I use Wireshark to see the http/tcp requests between the IPhone and the server. I see the IPhone request the mp4 and then I see the server send a "200 OK" response and then start to send the file. Soon after the server starts to send the file, the IPhone sends a "reset" request which stops the sending of the file.

Any ideas why the IPhone would reset the communication and stop the file from being sent? I am far from a regular user of Wireshark, so hopefully, my reading of the file is correct.

Here is an image of my Wireshark capture if anyone is interested. It clearly shows the reset from the IPhone.

Thank you for any help.


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

What http daemon software is the "proprietary" server running?


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

Hello Fjandr,

Sorry, I should have been more descriptive. The server is one that was created using c++ (Visual Studio 6.0) several years ago. They used the winsock libraries that were available at the time. I'm not very knowledgeable about winsock, but I have been afraid that IOS requires some handshaking that the older winsock libraries may not have. 

Non IOS devices access the video file from the server with no problems.

Thanks,

Dana


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

If it's a custom-built server, your best option is the person who built it. Is there a good reason why you needed an http server built from scratch, rather than one of the many available off-the-shelf options?


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

Unfortunately, the person who built it is long gone. It was originally built for one reason. To handle logging in of learners, presenting dynamically generated course content and tracking that content.

The courses are of a proprietary format and are adaptive. So, the server is a file server that only handles these courses and also does all of the content generation and adaptivity.

At the time (about 2000), I believe that this was the best way to do it.

I guess, it's gonna be more research.

Thanks,


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

What functionality is lacking when using another web server? It may be easier to adapt to a modern web server rather than adapt your web server to modern devices.


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

We have actually considered doing that (and may yet), but we're in a crunch to get this working using our existing technology. It does work fine on non-IOS devices. 

It would take considerable effort and time to reproduce the course intelligence, adaptivity, and tracking. Time that we just don't have at the moment.

I'm going to review everything that we are doing in creating these video files and presenting them. There may be something that we are missing.

Thanks for your questions and suggestions. They were helpful in getting me to rethink what we are doing.


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

You may want to try installing Opera Mini on one of these IOS devices and try the download using it. That will at least tell you whether it's the browser that's the issue, which narrows down potential sources of the problem.


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

Thanks for the suggestion, Fjandr. I installed Opera Mini and it downloaded the video which played on the IPhone. 

That is strange as all other browsers that I tried on the IPhone do not download the file. Yet, the versions of those browsers running on my android Nexus 5 and on my Windows PC download and run the same video.

I've got some more thinking to do on this. Obviously, we can't force people to use Opera Mini if they want to use our site. I'm gonna do a Wireshark capture of Opera Mini downloading the video and compare that to Safari not downloading it (both on the IPhone).

Thanks again for your help.

Dana


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

No problem at all, happy to help.

If Opera works, at least the problem is not hardware-based. Do you have other moderate to large-sized files served from this web server other than mp4 files? If not, you may want to try posting something of similar size and see if the IOS devices reset the connection when downloading other file types.


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

Interesting. I fired up Wireshark to track the download of the video using Opera Mini. The file was downloaded to here:

IP Address: 141.0.8.151
Host: s10-09.opera-mini.net
Organization: Opera Mini Proxies
ISP: Opera Software ASA

It was downloaded to that IP address (not my IPhone). It was then uploaded to the IPhone and then ran on the IPhone. So, the download from my server was not done by the IPhone at all. 

How strange it that?

I did get a pdf file that is more that twice the size of the video and it was successfully downloaded and opened by the IPhone.

Very interesting indeed. I'm scratching my head on this one and will keep searching for an answer.


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

A quick search explains the Opera Mini download.

"Unlike straightforward web browsers, Opera Mini fetches all content through a proxy server and reformats web pages into a format more suitable for small screens.[39] A page is compressed, then delivered to the phone in a markup language called OBML (Opera Binary Markup Language), which Opera Mini can interpret.[40] The data compression makes transfer time about two to three times faster,[23] and the pre-processing improves the display of web pages not designed for small screens."

So, I guess that it showed two things. 

1: the server can successfully send the video using HTTP.
2: the video will run on the IPhone

I already knew both after previous testing, but it's nice to have both verified and good to know about Opera Mini.


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

Ah yes, I had forgotten that about Opera Mini. Proxy connections are enabled by default so that all content is compressed. It's designed that way to reduce bandwidth use on cellular connections.

Try turning off the proxy/compression feature and see if it'll still download to the device.

Since you could successfully download another type of file without the IOS device resetting the connection, it means the problem is related specifically to the file or connection type used for the mp4 files. It's possible the IOS device is attempting to stream them interactively rather than downloading and running them. It's possible that's the cause of the connection failing if the web server was never designed to support streaming connections.


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

I've searched high and low for info on how to turn off the proxy or add my server address to a whitelist, but all information shows settings that are not available on this version of Opera Mobile.

I know that the file is fine, as the IPhone will properly play it when it is retrieved via an IIS server. It only fails on our server. Yet, it works fine on other devices.

Like you suggested, maybe the other devices accept streaming or not depending on the sending server and the IPhone will only accept streaming.

It definitely looks like our server is incompatible with IPhone (as far as video is concerned). The mime type that is being sent is correct, so it's something else.

I have found no documentation that says video must be streamed to an IPhone, but I haven't found any that says that it does not have to be, either.

More pondering and searching, I guess.


----------



## Fjandr (Sep 26, 2012)

*Re: IPhone Resets Communication from Server*

Hmm, that's unfortunate you can't turn off the proxy compression feature. The last version of Opera Mini I used could, but that was also the Blackberry version and not the IOS version. I don't know if it's a platform difference or if they just removed the feature entirely. Wish I could help more.


----------



## joeten (Dec 4, 2008)

*Re: IPhone Resets Communication from Server*

According to this you can change to opera classic which then downloads to the phone and not the server Opera Mini FAQ - Opera Software
but is restricted to android and windows phones which is unfortunate


----------



## danabaillie (May 6, 2014)

*Re: IPhone Resets Communication from Server*

This has been solved. Our server did not handle HTTP requests for partial content (i.e. Range: bytes=0-999). Range headers in incoming requests were being ignored.


We updated the server to handle these requests and IOS devices are now able to download video from our server.


See the link below for more info:


Hypertext Transfer Protocol (HTTP/1.1): Range Requests


----------



## joeten (Dec 4, 2008)

Thanks for getting back to us.


----------

