Code Monkey home page Code Monkey logo

clichat's Introduction

CLIChat

CLIChat - Chat rooms for the command line with no signups by sudocode1 & 1s3k3b.
Our official CLIChat server: 188.165.82.203:90


More pages

How to use

Connect to a server:

  • Download the source code
  • Download and Install Node.js
  • Locate to /<clichatdir>/client
  • Run npm i (first time only) and then node index.js

Host a server (or multiple servers):

If you want to host a secure server, look at the secure-server readme.
Download the source code, navigate to /<clichatdir>/server and edit index.js, there are two options near the top of the file:

// set the ports you want to host on if you need multiple servers
const ports = [90];

// set the words you want to filter from usernames and messages
const filter = ["the words you want to filter", "go here"];

If you want to host multiple servers, add more ports to the ports array.
The filter should have the words you want to filter from usernames and chat.

To start the server, run npm i (first time only) and then node index.js

Writing a custom client or a Bot

Writing a custom client or bot is quite simple (slightly different for secure servers).
There is an official API wrapper made for Node.js: clichat.js.
You can also make your own API wrapper by utilising this list.

  • Everything uses pure WebSockets & JSON.
  • Connect to the server using ['auth', {ip, username}] (IP is not currently used at all)
  • Messages should be sent as ['msg', {idOfUser, messageContent}]
  • Messages are recieved as ['message', {username, messageContent}]
  • A user disconnect is recieved as ['disconnect', username]
  • A user join is recieved as ['join', username]
  • You joining the room is recieved as ['id', yourID]
  • A server refusal is recieved as ['refusal', refusalString]

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.