🔗 Multi-Project Communication Server
Server Status: Checking...
📡 API Endpoints
- POST /api/send - Send data to specific project
- POST /api/broadcast - Send data to multiple projects
- GET /api/projects - List connected projects
📁 Project Files
- project1.php - Project 1 communication handler
- project2.php - Project 2 communication handler
- public/project-communication.js - Frontend JavaScript library
💡 Usage Examples
PHP (Send from Project1 to Project2):
$comm = new Project1Communication();
$result = $comm->sendToProject('project2', [
'order_id' => 123,
'status' => 'completed'
], 'order_update');
JavaScript (Receive in Project2):
const project2 = initProjectCommunication('project2', { debug: true });
project2.onMessageType('order_update', (data, meta) => {
console.log('Order update from', meta.from, ':', data);
});
API (Direct HTTP call):
POST /api/send
{
"from": "project1",
"to": "project2",
"data": {"order_id": 123, "status": "completed"},
"type": "order_update"
}