Week 12

Node and Web Socket

Introduction

1. Create a Folder

2. Use Terminal OR iTerm to Access the Folder

cd (change directory)
ls (list items)

3. Install Node.js

Download

https://nodejs.org/en/download/

Install

4. Check if it is installed well

node -v

5. Install Socket.io

https://socket.io/

https://github.com/socketio/socket.io

npm install socket.io

Installation Finished

  • node

  • socket.io

1. Server.js

2. index.html

Files are made

Now Let's RUN IT!!

1. Go to Terminal

node server.js

2. Check your Browser

localhost:3000/index.html

CTRL + C

It will kill the node server

killall node

It will kill node server

SERVER

1. You need a Hosting Server

2. Access the server by SSH with terminal

ssh root@111.111.111.111 

3. Node can be installed at the Ubuntu(Any) server

4. Install Necessary NPM's : Node Package Manager

  • socket

  • express

  • passport

  • etc

5. Once installed, you can browse the server

6. Upload Files

7. Go to the folder and RUN IT with Terminal

8. Go to 111.111.111.111:8000/index.html

http://YOUR_IP:8080/index.html

9. Ctrl + D to disconnect

Last updated