serg
serg

Reputation: 111265

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)?

Upvotes: 14

Views: 26311

Answers (7)

Nisan2049
Nisan2049

Reputation: 11

Best way is Install "Macromedia Flash Player MX" via Wine.. It will install Macromedia MX along with "Macromedia Flash Player".. Now just go to your swf file and change its default application to "Macromedia Flash Player"(not Macromedia MX)

Upvotes: 1

eaby188
eaby188

Reputation: 1

If you use ubuntu , type sudo apt-get install xvfb, and then download the flashplayer from adobe, and just try like this, it work well:

xvfb-run ./flashplayer test.swf

Or if you use windows, you can just double click the swf on the server, and it running now, communction with other server, just use this swf as part of server, calculate the value and return ,swf run loop for ever as it's a server

Upvotes: 2

ephemient
ephemient

Reputation: 204698

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

Upvotes: 9

macbirdie
macbirdie

Reputation: 16193

Adobe's Ichabod would probably solve your problem, but I can't seem to find any information whether it's available for public consumption, or just for search providers. Just an echo chamber of articles like one on ReadWriteWeb.

Upvotes: 1

MarkR
MarkR

Reputation: 63538

You could easily (ish) write a C program which implements the netscape plugin interface to interface with Flash directly. That would work.

However, it would probably still require an X server to do this - you could use XVnc or something to run headless.

Nontrivial, but would work.

Your requirement sounds a bit strange - perhaps it would be a more maintainable design to rewrite the Flash component in some other language.

Upvotes: 1

user8032
user8032

Reputation: 1221

Adobe Air?

The main problem is command prompt, not the "web accessibility". If you can run FireFox, I am sure you can load the file by filesystem path. I would be really surprised if it was possible to run SWF stuff on the command line. I mean, not that this is not possible in principle, it's just that the point of SWF is usually in displaying some blinking and jumping junk, so nobody bothers to write command-line tools to run it...

PS. I assume you are aware of the fact that you can run FireFox on a Linux server, right? (The whole X Windows thingie?)

Upvotes: 1

Wayne
Wayne

Reputation: 3435

You could make the SWF web accessible and protect the directory using .htaccess files.

See Apache .htaccess Tutorial for further information.

You could also try ffplay (ffplay -fs somefile.swf) to run the swf.

Edited: Looks like ffplay uses SDL so X may not be required.

But I dont think this would be installed on your server. YMMV

Updated: Dont let the no GUI stop you in what you can do, if you use SSH look at this article how to export your X display to your local workstation. Trying to tunnel X over SSH

Upvotes: 1

Related Questions