PWA in localhost on mobile

i saw many things on internet but for my is not clear how to run my pwa in localhost on mobile. It is normally installed as pwa BUT i need to be in localhost to avoid problem of HTTPS certification to use an external device like esp32 with websocketclient.

Can you help me ?

Guido, localhost is a synonym for; i.e., the machine on which the browser is running. You can't treat another machine as the localhost.

sorry i was not clear ... pwa installed normally run checking https origin like my app... If i compile and run my app on my PC it can connect to an external device via socket... but if i run my app from here : BLUSIMP by Water Monitor it can't connect to external device due https security problem.. There are many many articles in internet about this problem. Now i want a way to run app on mobile android or ios in localhost ... i hope is clear now ...

If I now understand what you mean, the way to avoid COR issues is to have your PWA app get all of its data from That is, the data from other sources must be fetched by the server that's hosting your app. The app cannot directly access a different server, as that's what COR is specifically designed to prevent. (You can circumvent this with a COR-defeating browser extension, but that is obviously a security risk)

see these for example

Those examples underscore what I said: The PWA needs to be installed from a secure server and to fetch all of its data from that same server.

Terry my app do this ... its ok, go fine. The problem is when i must connect via socket to an external device like arduino esp32, the connection need also security. Now i can't do this and i'm looking a way to avoid this problem for example to run PWA in localhost on mobile. I checked in localhost i can connect to device. I'm thinking also to a TMS web server installed to a mobile ... i can do this ?

All evidence I can find is that this isn't possible.
All answers to your posts here seem to confirm this, including this one:

Excuse me i'm crazy ... but why my PWA compiled in localhost with delphi and your TMS web server, this


can connect to esp32 device wroom via socket ?i hope undrstand me ....

Because server and client app are both running & connecting from

ok ... i want to create same thing in a mobile (android or ios). Can i do this ?

see : progressive web apps - Install pwa in smartphone with localhost - Stack Overflow

IIUC, doing what you have in mind would require that you also install the server on the Android or iOS device as well. I'm that case you might as well just write a native app for those devices.

One of my ideas is to write an APK (for ios i don't know) which contain all webapp files end the server to run in localhost. I don't known if i can use the TMS web server for this scope !

I think my idea is usefull for all people that have problem to comunicate with device like esp32 via socket.

PS : i've already a native application but every time is out a new android version is a problem 12,13,14... i'm tired to test and correct every time permissions , new features and so ....

any news for me ?

I'm not sure what news you expect?

... instructions about using PWA in localhost. Can be a good idea using your web server ? can i compile and run it for android ?

PWA is not designed to run under localhost
It contradicts how the PWA would work (and update itself)
The web server that comes with TMS WEB Core is designed for Windows and for TMS WEB Core debugging purposes only.
You can create a HTTP server with Indy or with our TMS Sparkle components for Android.