-
Hello, Is there any way to create local connection via LAN. For example I have two desktop application created by native php and can communication each other. Or may be I miss read the documentation |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The networking features of PHP just sit on top of the operating system's network stack, so you should have no problems making requests across the local network from PHP. As for getting one app to talk to another across the network, you'd need to have the app spin up some kind of socket service that is able to listen on an available port and on the correct IP address. I recommend you prototype this outside of NativePHP to start with (e.g. just write a PHP script that does this), to prove out the logic and figure out some of your edge cases before trying to add this complexity inside your NativePHP app. Some things you'll need to consider:
None of this is peculiar to NativePHP. |
Beta Was this translation helpful? Give feedback.
-
Our Child Processes functionality got released yesterday! You'd now just need to start a process on each side that listens on a port that is accessible to other devices on the network - for example, you may be able to use |
Beta Was this translation helpful? Give feedback.
No. You'd need to spin up a separate process to create your own service.
All of my considerations above would still apply.
We are working on a standardised approach to this.
You should not rely on the fact that NativePHP currently uses web servers internally - this behaviour is very likely to change in the near future.