Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Any solutions could host the web app developed by Qt(like aws)



  • Today exist solution like AWS, google cloud platform and Azure which could host static website written by html and js on their servers, are there exist any solutions which could host the web app developed by webassembly?


  • Moderators

    All the providers you mentioned should support Qt webassembly without issues. Just try it out.

    People are even using github's hosting to deliver WebAssembly apps, it works. There is really no special stuff required to host wasm content, from the perspective of web server it's just a few static files.



  • @sierdzio Thanks, I try with amazon S3, it works, the steps are

    1. Upload the files [appname.wasm, appname.js, appname.html, qtloader.js, qtlogo.svg(optional)] to the S3 bucket
    2. Go to permission->block public access->turn off
    3. Go to overview->select all files->right click your mouse->make public
    4. Open the [appname.html] from S3, open the [Object URL] in your browser, you should see the webapp running on your browser

    Questions:

    1. Make everything public looks dangerous, any better way?
    2. It do not works with github, when I open the link of the appname.html , it show me the contents of the html, but not the webapp. Guess I need github page?


  • @tham
    Yes, github is intended to show text content of all files all the time, even if they happen to be .html. That github page would execute a .html as an HTML page, so should work as WASM.



  • Thanks to all of you, github works too.

    1. Create a new repository
    2. Upload the files generated after compiled[appname.wasm, appname.js, appname.html, qtloader.js, qtlogo.svg(optional)]
    3. Go to the settings page of your repository, go to source and set master as source(follow this page)
    4. After you setup the source, the page should told you where are your project hosted, in order to access the wasm app, enter url as "your_site_url/appname.html"


  • @tham
    So you don't need to do github page? So what is the "difference" between github page and github approach/result/purpose?



  • @jonb said in Any solutions could host the web app developed by Qt(like aws):

    So you don't need to do github page? So what is the "difference" between github page and github approach/result/purpose?

    I am following tutorial of github page, just post out the part work for Qt for weassembly.
    Do QNetworkAccessManager of webassembly support post operation to https server(content type is json)?
    Write the file to local I guess could be done with this example


  • Moderators

    Hey, many thanks for posting steps, it will help others!

    @tham said in Any solutions could host the web app developed by Qt(like aws):

    @jonb said in Any solutions could host the web app developed by Qt(like aws):

    So you don't need to do github page? So what is the "difference" between github page and github approach/result/purpose?

    I am following tutorial of github page, just post out the part work for Qt for weassembly.
    Do QNetworkAccessManager of webassembly support post operation to https server(content type is json)?

    I have not tried WASM with SSL yet, but with normal HTTP, post operations work without problems.

    Write the file to local I guess could be done with this example

    Good find. Writing to files will be added in Qt 5.14, too, so QFile will start working (with some caveats for sure).



  • @sierdzio said in Any solutions could host the web app developed by Qt(like aws):

    I have not tried WASM with SSL yet, but with normal HTTP, post operations work without problems.

    I think it do not work with ssl, please check this post

    @sierdzio said in Any solutions could host the web app developed by Qt(like aws):

    Good find. Writing to files will be added in Qt 5.14, too, so QFile will start working (with some caveats for sure).

    Thanks, hope it could help someone in the future.


  • Moderators

    Indeed, it's not ready yet. https://bugreports.qt.io/browse/QTBUG-76350

    Honestly I have no idea why Qt Company decided to declare Qt WASM a "supported" platform. Yeah it is an awesome technology, but current state of the module is definitely still a "technology preview" :/



  • @sierdzio said in Any solutions could host the web app developed by Qt(like aws):

    but current state of the module is definitely still a "technology preview" :/

    Thanks for pointing out the bug, agree with you, without ssl support many things can't work, they treat this issue as P2, guess I will have a long time cannot use Qt to call the api of aws, unless not by QNetwork module, guess I better study html, css, js if I want to use the services of aws(lambda, cognito, dynamoDB) before Qt for webassembly become more mature.



  • @sierdzio
    I'm a noob to Qt for WebAssembly, but intrigued by the long-term potential. From my web reading, I believe that many other companies are interested in his technology as the future for much web programming, not to completely replace JS but for much of the code. Does that sound about right?

    So, you are saying that the current Qt offering is "lacking" in support for certain key functionality, and it will take a couple more releases to get to something you would regard as "acceptable", is that right?

    For my interest, it would need to support MySQL database access. I understand that it supports SQLite now, but I presume that is for access to a local file SQLite, correct? Will we get access to a remote MySQL database on the web server over WASM, or is that not going to happen?

    Thanks!


  • Moderators

    @jonb said in Any solutions could host the web app developed by Qt(like aws):

    @sierdzio
    I'm a noob to Qt for WebAssembly, but intrigued by the long-term potential. From my web reading, I believe that many other companies are interested in his technology as the future for much web programming, not to completely replace JS but for much of the code. Does that sound about right?

    Yeah a lot of people have a lot of hope for WebAssembly and it is getting traction very fast. Whether it will take over the world - I have no idea and have my doubts (mostly due to code size and lack of built in libraries - for some big projects and frameworks the download would be huge, esp. when compared to tiny HTML+JS+CSS alternative). We'll have to wait and see.

    So, you are saying that the current Qt offering is "lacking" in support for certain key functionality, and it will take a couple more releases to get to something you would regard as "acceptable", is that right?

    Hey, I'm just a guy who has tested Qt for WebAssembly a bit. I don't claim may views are in any way official or binding. For me, QFile, QSettings and SSL have to work in order for this platform to make sense. QtSQL is high on that list, too.

    But, if you don't need any of that, the current offering (full QtWidgets and QML support!) is very good.

    So the best answer I can give is "depends" ;-)

    In Qt 5.14, Qt for WebAssembly will be much better.

    For my interest, it would need to support MySQL database access. I understand that it supports SQLite now, but I presume that is for access to a local file SQLite, correct? Will we get access to a remote MySQL database on the web server over WASM, or is that not going to happen?

    I don't know, ask Qt developers not me. They can be found on qt-devel mailing list.



  • @jonb said in Any solutions could host the web app developed by Qt(like aws):

    @sierdzio
    I'm a noob to Qt for WebAssembly, but intrigued by the long-term potential. From my web reading, I believe that many other companies are interested in his technology as the future for much web programming, not to completely replace JS but for much of the code. Does that sound about right?

    So, you are saying that the current Qt offering is "lacking" in support for certain key functionality, and it will take a couple more releases to get to something you would regard as "acceptable", is that right?

    For my interest, it would need to support MySQL database access. I understand that it supports SQLite now, but I presume that is for access to a local file SQLite, correct? Will we get access to a remote MySQL database on the web server over WASM, or is that not going to happen?

    Thanks!

    You have to understand that Qt for WebAssembly lives in the same sandbox that javascript does. Local system file access is not straightforward and we had to add a special wasm only way to access the systems filesystem.



  • @lorn-potter
    Hi , Yep, I get that. So how likely are you to allow any kind of server database access? :) I want those QSql... (with QMYSQL, back to the web server) classes to work, please!


  • Moderators

    @lorn-potter said in Any solutions could host the web app developed by Qt(like aws):

    You have to understand that Qt for WebAssembly lives in the same sandbox that javascript does. Local system file access is not straightforward and we had to add a special wasm only way to access the systems filesystem.

    Absolutely, I don't claim it is easy, I'm sure it's hard and painful, and devs working on it have my full respect! I just say it's necessary to have QFile/QSettings supported :-) I'm perfectly OK with no direct filesystem access, but some storage like browsers have (I'm not a web dev so I don't know the lingo, but I think there is something like LoacalStorage or OfflineStorage or something like it).



  • @jonb It is more a question of when. There are higher priority issues that need to be worked out first. That said, sqlite is on the list of things I want to enable at some point in the future.



  • @lorn-potter If I am correct, the sandbox do not allow you to connect with the db like mysql, mariadb directly, the server side need to use another way to communicate with the web app. Anyway to break this limit?


Log in to reply