Web interface for a C ++ program

I am developing a project to complete my research. This project basically works as a server, is cross-platform, and is developed in C ++.

I was wondering if it is possible to create a web interface that can be used, for example, a listener design template to register what the program does. This will be a cross-platform and ideal because the program should run on a remote server.

My question is: are there any web technologies that allow me to update my web page in real time when the program is recording something. I know that this is something unusual, and I'm not an expert in the field of web technologies, so I ask.

Will Erlang do this?

thanks for the help

EDIT: To give a more concrete example, I would like to be able to follow my program live and see how my program logs appear on the page. The idea would be to use a webpage, for example, I would use WPF on Windows or GTK for Linux. As someone said, it will be some kind of monitor view for my application.

+4
source share
2 answers

It is much easier than you think. The web server basically receives the request as the path name and returns the page. If you configured it correctly, it will call the program to create the content. This is called "CGI".

If you can do this without a live update, then this is just super: just refresh the page and your program can be called again.

If you need live updating, you need to do a little more. The easiest way is to make javascript a bit easier. The magic word here is AJAX. There are a number of on-line tutorials for both of them, just Google.

The main thing is to start with a very simple example and add to it. Javascript in particular is a little weird; Follow the instructions and you will receive it.

+6
source

You can embed a web server such as http://code.google.com/p/mongoose and poll it with xhr or better use websockets.

Or use a monitoring solution such as Nagios (Nagios Core is free).

0
source

Source: https://habr.com/ru/post/1436905/


All Articles