This is distrubuted system project simulating a SMS distributed solution for Mexico INE votation using C++ UDP Sockets and SQLite
Server that listens UDP request from votation and sends updates to web clients through socket.io.
git clone <repository-url>
this repository- change into the new directory
cd web-server
npm install
- open
config.json
file - update
udp
,http
andexpress
default server settings - set
step
for the number of votes received before sending an update signal to the clients. The server also sends updates every second automatically.
{
"udp": {
"host": "0.0.0.0",
"port": 7777
},
"http": {
"host": "0.0.0.0",
"port": 8080
},
"express": {
"host": "0.0.0.0",
"port": 8081
},
"step": 1000
}
node server
- Visit app at http://localhost:8080
Client that listens web server updates from votation through socket.io.
git clone <repository-url>
this repository- change into the new directory
cd web-client
npm install node-static
- open
index.js
file - modify app
socket
andhttp
configuration vars
{
...
socketURL : 'http://localhost:8080',
httpURL : 'http://localhost:8081',
...
}
static -a 0.0.0.0 -p 8082
- Visit app at http://localhost:8082