How to connect PC App and Web App together

Discuss PC Developer and Web Developer projects and features here.
Post Reply
stefan.erni
Valued Contributor
Posts: 1247
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 230 times
Been thanked: 247 times

How to connect PC App and Web App together

Post by stefan.erni »

Hi Steve

I have two demo programs, and both work well.

I can set up a PC Web server, and I can use the Web App to retrieve text from the matrix server, which works

But when I try to retrieve text with the Web App from the my web server (localhost), it doesn't work yet.
Webserver_FileSystem (1).fcsx
(15.05 KiB) Downloaded 19 times
2026-06-12_17-45-01.PNG
2026-06-12_17-45-01.PNG (24.55 KiB) Viewed 47 times
WebFetchHTML.fcsx
(11.56 KiB) Downloaded 18 times
2026-06-12_17-46-59.PNG
2026-06-12_17-46-59.PNG (12.4 KiB) Viewed 47 times

Steve-Matrix
Matrix Staff
Posts: 1931
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 286 times
Been thanked: 450 times

Re: How to connect PC App and Web App together

Post by Steve-Matrix »

I've edited your files to show how this could happen.

Some changes I made to the Web Developer app:
  • The DataType is now JSON Encoded
  • The URL is a local IP address as created by the PC Developer app's Network Comms IP Address
  • The ProcessResponse macro extracts the "Data" tag from the received JSON packet
Some changes I made to the PC Developer app:
  • Removed the File I/O component
  • Changed the HTML source to Embedded
  • Added a custom header for CORS and JSON
  • Added the "fetchtest.txt" file with a JSON string
When you simulate the PC Developer app, your firewall will probably ask to allow Flowcode access to your network. You will need to allow it.

You can test to see if the PC Developer web server is active by opening page the following in a browser:

Code: Select all

http://192.168.0.90/fetchtest.txt
It should report the JSON string.

The IP address is likely to be different and is the one specified by the Network Comms IP Address property.

Here are some images showing it working:
PC Developer webserver test.png
PC Developer webserver test.png (14.09 KiB) Viewed 37 times
Web Developer app.png
Web Developer app.png (10.4 KiB) Viewed 37 times
Attachments
WebFetchHTML_ST.fcweb
(11.31 KiB) Downloaded 11 times
Webserver_FileSystem_ST.fcpcd
(14.33 KiB) Downloaded 10 times

Post Reply