Skip to content

brworkit/nodejs-socketio-client-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Socket Node Client and Server

Description

Client and Server programs for testing socket communication.

Requirements

For development, you will only need Node.js and a node global package, installed in your environement.

Node

  • Node installation on Windows

    Just go on official Node.js website and download the installer.

  • Node installation on Ubuntu

    You can install NodeJs and npm with apt install, using the following commands:

    $ sudo apt install nodejs
    
    $ sudo apt install npm
    
  • Other Operating Systems

    You can find more information about the installation on the official Node.js website and the official NPM website.

If the installation was successful, you should be able to run the following command from your command line:

$ node --version        

$ npm --version

Socket IO

Socket IO

$ npm install socket.io

Socket IO Client

Socket IO Client

$ npm install socket.io-client

Installation

Project

$ git clone https://github.com/brworkit/socket-node-example.git
$ cd socket-node-example

Usage

Start server using:

$ npm start server

Start client using (in another bash):

$ node client.js

You will see in your client prompt the current time from Javascript Date class in ISO format:

{ time: time ISO format }

You you see in your server prompt:

client <client id> connected <time ISO format>.

License

MIT License.
Copyright (c) 2020 brworkit.

About

A socket client-server example.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published