$30
Project 1 - Basic Socket.io
Basic Socket.io
This project involves some simple Socket.io communication between the browser and the Node
script running the Socket server.
When discussing the console in the server, I mean the terminal window in which the Node
process is running. When discussing the console in the browser, I mean the developer tools in the
browser.
Requirements
Here are the requirements:
1. Spin up a Socket.io server on port 3000 on your local host
2. When a browser connects to the Socket server running on port 3000 on the local host, the
server should write "Client connected" to its console send some kind of "Hello" message to the
browser. This can literally be a message saying "Hello".
3. Upon receiving the "Hello" message, the browser script should send some kind of message
back to the server (it can even be something saying "Hi there").
4. Upon receiving the "Hi there" message from the browser, the server should send back some
kind of "How are you?" message.
5. Upon receiving the "How are you?" message, the browser should respond back with "Great"
or something like that.
6. Upon the browser disconnecting from the server (i.e. closing the window), the server should
write "Client disconnected" in its console.
Grading
This assignment is worth 20 points weighted at 10% of the grade.
Submit a ZIP file containing your server script, browser script (html file), and your package.json
file.
I will be using Chrome to grade everything since other browsers can be funky at times.