I've already developed several web-based application using Qt5 as engine for data processing. The webpages are accessed from remote terminal, often from smartphones. Here my current approach:

- on the server machine (often a small SBC) I run any http server, i.e. lighttpd - I develop the user interface in html5 and javascript - to handle actions and behavior of the UI - on the server runs also a Qt5 application which provides the communications with the outside world (database, local I/O, fieldbus, etc...) - both the webpages and the "core" Qt5 application exchange data using a websocket. In this way I can transmit and receive data between the user side and server side

This approach works but has several drawbacks:

- it's not so easy (for me at least) to provide server side code to make a really dynamic pages. I found two ways: 1. send the generated html code through the websocket and use a javascript function to put it into the actual page, 2. use some server side language (i.e. cgi) and create another communication channel between it and the Qt5 application. Currently I create the contents directly from javascript, but this is not so safe

- the websocket(s) requires at least to open one more port than the default 80 and that should be forwarded to the http server

- for the same reason it's hard to have more servers in the same LAN because you have to forward both ports (http and websocket ones) to the correct local ip

That said, I have few questions:

1) in general, this is the best approach or you might suggest a better one?
2) any hint about the drawbacks?
3) until now the webservers were designed to answer to only one client, but in the next project the web-application should be used by dozen of clients at the same time (the goal is to acquire some data and put it into a db, taking care of which user submitted). I guess it's much better to put the webpages on a reliable third-party hosting provider, but then I'm afraid I also need to set up my own server to run the Qt5 application

Thanks for any suggestion!

Interest mailing list

Reply via email to