ICL
Search…
Week 12
Node and Web Socket

Introduction

1. Create a Folder

2. Use Terminal OR iTerm to Access the Folder

1
cd (change directory)
2
ls (list items)
Copied!

3. Install Node.js

Download

Install

4. Check if it is installed well

1
node -v
Copied!

5. Install Socket.io

1
npm install socket.io
Copied!

Installation Finished

  • node
  • socket.io

1. Server.js

server.js
2KB
Text
server.js

2. index.html

index.html
1KB
Text
index.html

Files are made

Now Let's RUN IT!!

1. Go to Terminal

1
node server.js
Copied!

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

Copied!

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

How To Install Node.js on Ubuntu 16.04 | DigitalOcean
DigitalOcean

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

Could not load image

8. Go to 111.111.111.111:8000/index.html

http://YOUR_IP:8080/index.html

9. Ctrl + D to disconnect

Last modified 3yr ago