Git Product home page Git Product logo

lab-06-tcp-chat's Introduction

cf lab-06-tcp-chat-server

To Submit this Assignment

  • fork this repository
  • write all of your code in a directory named lab- + <your name> e.g. lab-duncan
  • push to your repository
  • submit a pull request to this repository
  • submit a link to your PR in canvas
  • write a question and observation on canvas

Include

  • gitignore
  • eslint
  • package.json
  • include any npm scripts for starting server, linting, testing, etc
  • readme
  • Write a paragraph about your project
  • Write docs on how to get the project running
  • Write docs on how to connect to the server
  • test your code
    • ensure that all of your methods have test coverage
    • write tests which start your server, send and receive, and confirm functionality

Directions

  • Create a TCP Server use using the net module
  • Create a Client Constructor
  • When sockets connect to the server a new Client instance should be made
  • Clients should have a unique id from node-uuid
  • e.g. 2309-4802-3948-...
  • Clients should have a unique 'nickname'
  • e.g. guest-43
  • When sockets are connected with the ClientPool they should be given event listeners for data, error, and close events
  • When a socket emits the close event the socket should be removed from the client pool!
  • When a socket emits the error event the error should be logged on the server
  • When a socket emits the data event the data should be logged on the server and the \wack commands below should be implemented

Wack commands '\'

  • \all should trigger a broadcast event
  • \nick should allow a user change their nickname
  • \dm should allow a user to send a message directly to another user by nick name
  • when a user speaks their nickname should be printed
  • i.e. teapot: Sup Hacker?

Bonus

  • 2pts Write a test that tests \nick actually changes a clients nickname

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.