Unsolved Making requests to a local Python server from the Vivace screen HTML file?

Discussion in 'Mod Support' started by pc-guy-2019, Mar 29, 2021.

  1. pc-guy-2019

    pc-guy-2019
    Expand Collapse

    Joined:
    Dec 18, 2019
    Messages:
    2
    Hi, I'm trying to create a mod for the Vivace, modifing the screen to display the currently playing media name in place of the Radio Haricot text. I found that the only way would be to set up a Python Flask server which would get the currently playing media name using the winRT package (only Python and C# I believe), then the modified HTML cherrier_navi_screen.html would make a JQUERY request to the server and get the media info, then display it on the screen. Everything works as intended when I open the file in a plain browser, outside of the game. However, when I try to run it in-game, it doesn't put the playing media's name in the screen. In the console, I found the following error message:
    BEAMNGCEF::BNGCefClient::OnBeforeResourceLoad Ressource cancel URL=http://127.0.0.1:5000/data

    BEAMNGCEF::BNGCefClient::OnResourceResponse VehicleTex-@vivace_gps_screen | http://127.0.0.1:5000/data | response: 0 -

    Now, I believe its something with the JS not being able to make request to localhost, as its 'scope' is limited to just BeamNG. Do you have any idea of how I could achive what I want? Maybe some other IP I should use?

    Files: https://drive.google.com/drive/folders/1B_wT8_zmZKSJPvhk3n5X-SIq2YX44gst?usp=sharing

    Probably a bizzare question, I know. Thanks in advance.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice