SUPRATIM
SUPRATIM

Reputation: 3

Running C on webpage

I have a client server program on C. The program has used libraries such as ffmpeg, libfftw3 etc, now I want to run it on my webpage. I have object files as well as executable files compiled from the C programs. I was searching for some platform which will allow me to run the client-server, just like the way a shell script on terminal allows.

Can anyone please tell me how can I do it.

Upvotes: 0

Views: 1602

Answers (1)

Joe
Joe

Reputation: 301

You can run the program "from your web page" if you rebuild your program using Google's Native Client (NaCl) libraries. https://code.google.com/p/nativeclient/

This builds an executable that is run from Chrome, on the users machine, inside a sandboxed environment. The executable is built and distributed in an intermediate, machine independent format that Chrome coverts into a runtime format when it downloads and runs the app.

The performance is good (a little slower than full speed). The downside is that you are limited to the NaCl libraries. And, you have to run the app with Chrome.

If you want to run this in a client-server configuration, you can have the server run on the same machine or on a different machine.

It's easier to write the server program on your own server machine once and communicate via sockets, otherwise you have to port it to all the machines you want it to run on.

If you are interested in running the server on your local machine, you can use WebSockets to connect simple web pages with HTML and JavaScript to the server.

The right approach depends on what your needs are.

Upvotes: 2

Related Questions