Search code examples
linuxflash

How to run SWF without a browser (on a Linux server)?


I have a SWF file that connects to a remote flash server and receives some data. For security reasons I can't make this SWF file web-accessible so I can't use a browser to run it. Is there a way to run it on the server side from a command prompt (under Linux)?


Solution

  • You can use Xvfb or Xfake to run a X server that doesn't interface to real hardware. If they aren't available as packages for your distribution, you can build them from the Xorg xserver sources.

    (Or use MarkR's Xvnc suggestion.)

    The Adobe plugin used to ship with a stand-alone executable named flashplayer or gflashplayer, which was usable outside of the browser. I think it still exists, but is in the developer package, or something like that.

    If you're using a free implementation of Flash, both Gnash and Swfdec come with stand-alone gnash and swfdec executables respectively.

    This starts Xvfb on display :20 (just make sure to pick a number that's not in use; normal displays start at :0, ssh's X forwarding typically allocates :10 and up, and I've seen some Xvnc setups start at :90), and runs gnash inside of it:

    startx /usr/bin/gnash http://url.to/flash.swf -- /usr/bin/Xvfb :20