I've implemented an embedded localhost web server demo for fpwebview. The demo runs on Linux macOS, and Windows 10. Here's a Linux screenshot:
The program consists of a multi-threaded web server listening on
and the web browser widget showing the content, styled by CSS, all loaded from
said web server.
Because the embedded web server is listening on
could visit it with a regular web browser running on the same machine.
However, in the demo program, the buttons work by using
Pascal. From a regular web browser, clicking those buttons will have no
Pascal procedures implementing the buttons' functionalities.
For serious usage beyond a demo, additional security measures are possible to ensure that the embedded web server serves only the web browser widget and no other client.