This is a paste server written in Express.js and Node.js. I wrote it because I needed a paste server that I can use to paste data using Netcat. I looked into Termbin and Fiche; they are really good, but I prefer Node.js, so I created this.
Self-explanatory examples:
echo Hello, World! | nc your.servers.ip 6881
cat file.txt | nc your.servers.ip 6881
In case you installed the server on your local machine:
cat /proc/cpuinfo | nc localhost 6881
You will get an url to your paste as a response, e.g.:
http://127.0.0.1:3000/muYhQ0
If you want to run the server on ports other than: or you want to use any other directory for the data directory, then you should edit the config.json file. That is the configuration file of the application.
The default configuration looks like this:
{
"brand": "Tuxy",
"webPort": 3000,
"ncPort": 6881,
"dataDir": "data",
"idLength": 6,
"url": "127.0.0.1",
"storageSize": 256
}
You should edit this configuration, and customize it for your needs.
-
Clone the repository:
git clone https://github.com/TuxyMuxy/ncbin-js
-
Install the required libraries:
npm i body-parser express net randomstring socket.io
-
Run the server:
node index.js
If you want to use this server, and the client, you should have node.js, and netcat installed on your computer. You probably already have netcat - try typing nc
or netcat
into your terminal!
- Add netcat server
- Add informational messages
- Add posting via curl
- Add debug functionality
- Add ssl/https