URLRequest: What’s Going on Behind the Scenes?

At work today, a co-worker was trying to make a request to load a file from the server. It’s pretty standard stuff, and all his code was correct, but for some reason he kept getting IO errors. This usually means the file you’re trying to load doesn’t exist or the URL is not pointing to the correct place. But when we copied and pasted the URL into Firefox, it pulled up the file just fine. Weird…

So we decided to try an experiment. Instead of navigating to the URL in Firefox, we tried it in Internet Explorer. IE would not only not load that URL, but it wouldn’t load any websites at all. A quick look through his connection settings revealed they had somehow been changed to using a proxy server. Changing them back to automatically detecting the settings allowed him to access websites in IE again, including the file using the test URL. Then, we tried it in Flash again, and voilĂ ! It worked!

So what’s going on here? It seems pretty clear that Flash doesn’t have the capability to actually make URL requests of any kind, and relies on the browser to make those requests. From what I can tell, when you’re testing locally, behind the scenes Flash is loading the IE browser engine and uses that to make the requests. Interesting!

I’m not sure exactly how this works, or how it works on other operating systems, but it seems like Flash determines the operating system, knows what the default browser for that operating system is, and pulls in the browser engine to actually make the requests.

So, just in case you run in to any issues where Flash won’t load files from a network when you’re testing locally, check to make sure your operating systems default browser can connect to the internet. If it can’t, neither can Flash!

Have a similar experience? Know what’s really going on here? Let me know in the comments!

About Josh
Father of 3, programmer, husky owner, and a lover of geeky things. Find me on twitter @joshbjosh.

No Comments, Be The First!

Your email address will not be published.