Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 817 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 817 Bytes

WebSocket + Node.js + Python 3

Example of a simple application using WebSocket and Node.js to create a Python 3 process to calculate the factorial of a number and send the result to client.

Ready for deployment to Heroku.

Client

Simple HTML page with the libraries:

  1. jQuery;
  2. Bootsrap;
  3. ReconnectingWebSocket: keep the connection alive if eventually is dropped.

Server

  1. Node.js;
  2. Express framework;
  3. Python 3: used to do the dirty work (Python process invoked by Node child_process module);
  4. ws: a Node.js WebSocket library.

Usage

node app.js

and navigate to:

localhost:3746