Skip to content

Instantly share code, notes, and snippets.

@andreaj8
Last active August 29, 2015 14:22
Show Gist options
  • Save andreaj8/f9b4d9864d1220259e5b to your computer and use it in GitHub Desktop.
Save andreaj8/f9b4d9864d1220259e5b to your computer and use it in GitHub Desktop.
Socket Push NodeJs proxy design
[Pagina di testing PHP]
1) PHP serve una pagina munita di un ID univoco (come simulazioned di utente in sessione)
2) La pagina servita si collega ad un server per il socket [server node]
3) la pagina ha un tasto like, che chiama PHP e simula l'operazione di like, dopo di che la pagina PHP fa una chiamata HTTP GET ad un andPoint del server NODE con due parametri GEt : ID, messaggio
[Server NODE]
1) Espone un endpoint
2) Alla ricezine della chiamata manda un messaggio al client ID con il messaggio
[PAGINA HTML]
Riceve il messaggio dal soket e visualizza un alert con il testo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment