K
K
kossnocorp2011-04-04 13:24:06
Apache Flex
kossnocorp, 2011-04-04 13:24:06

Proxy swf bridge to bypass sandbox flash restrictions?

Task: to make it possible to send requests to the Internet from a flash launched from a local protocol (widget://, file://, chrome-extension://) without special permissions to www.macromedia.com/support/documentation/en/flashp. ..
Proposed solution: the proxying swf file (bridge), which is loaded into the page opened by the browser via the file (or widget or chrome-extension or any other non-http) protocol, loads another swf file into itself, which is located on the http server. This swf bridge passes all its js calls from the browser to the http swf file, and accordingly receives everything from it and passes it back to the browser.
The solution is based on the assumption that the sandbox model is based on the protocol (link) on which the flash is loaded, so http swf can normally send requests to the Internet (and communicate with its parent to perform the actions we need).
YouTube videos have this implementation - if they are embedded in a local page, they are normally loaded and played. (oddly enough, you can embed a flash from an http server into a flash running locally - perhaps this is only inherent in flash 8 or 7)
As a result, it should turn out that soundmanager2 www.schillmania.com/projects/soundmanager2/(a project for playing audio and video files in the browser completely through the js interface using flash) opened locally on the computer via file:// (flash 9 version) will normally initialize through this proxy, download, play and display files from the Internet. He is specifically interested in this version github.com/scottschiller/SoundManager2/tree/V2.95b...
As far as I suppose everything should be simple, something like this (abstractly)

<pre>//proxy - глобальный объект этого файла
var api_donor = (new FlashFileLoader()).load('http://d.com/swf/soundmager.swf');
proxy.externalInterface.in = function () {
    api_donor.in.apply(api_donor, arguments);
}
api_donor.out = function () {
    proxy.externalInterface.out.apply(proxy.externalInterface, arguments);
}</pre>

www.flasher.ru/forum/showthread.php?t=149504&highl...
help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e6...
You can see how the YouTube video works.
My friend is interested in this proxy in order to play music in the opera extension for his seesu.me project without requiring the user to put special extensions on this page www.macromedia.com/support/documentation/en/flashp... (with permission SoundManager2 initializes normally)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
exIV, 2011-04-18
@exIV

As far as I understand, to completely bypass the Flash sandbox, you will need to build a proxy on one of your
domains, or rather, on the one from where Flash will be loaded via http. At the root of this domain, you will need to
put

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question