Skip to content

CleverCloud/nodejs-tcp-chat-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TCP Chat demo

A dead simple TCP chat built for Node.js with JavaScript.

screenshot of the TCP chat

Install dependencies

To run this project, you need to install its dependencies with:

npm run install
  • To add some colors and text style in the TCP chat, we use colors
  • To control the terminal cursor and contents, we use ansi-escapes

Run

To run this project, you can use the start npm script like this:

npm run start

If you're contributing to this project and work with it on your local machine, you can use the start:dev npm script like this:

npm run start:dev

nodemon will watch your files and auto restart the server when you change something.

Deploy

To deploy this demo on Clever Cloud:

  • You can create your app in the console UI and use a git push
  • You can also do everything with the clever-tools CLI:
clever create -t node tcp-chat-demo
clever env set TCP_PORT 4040
PUBLIC_TCP_PORT=$(clever tcp-redirs add --namespace cleverapps | sed 's/.*: //g')
clever env set PUBLIC_TCP_PORT ${PUBLIC_TCP_PORT}
clever deploy

Once this is deployed, you can browse your app as HTTP with:

clever open

It will prompt you a nc command to connect to your TCP chat.

About

Run a dead simple TCP chat on Clever Cloud

Topics

Resources

Stars

Watchers

Forks