This is a real-time web application built with Node.js, Express, Multer, and Socket.IO. The application allows users to share text and files between multiple devices without requiring login or registration. The shared text and files are updated automatically in real-time between devices. It is intended for fast sharing text and files between multiple devices.
- Directly access the clipboard, no rooms or login required.
- Real-time text sharing between multiple devices
- File upload and deletion with real-time updates
- Download files directly using
curl
or a web browser - Get the text directly using
curl
- Simple code
- Lightweight
- Node.js (v12 or higher)
- npm (v6 or higher)
- Clone the repository:
git clone https://github.com/SaidTorres3/realtime-clipboard.git
cd realtime-share-app
- Install the dependencies:
npm install
- Start the server:
node server.js
The default host is 0.0.0.0
and the default port is 8088
.
To specify a custom host and port, use the following command:
node server.js -a 0.0.0.0 -p 8088
- Open your web browser and navigate to
http://localhost:8088
to use the application. (Replacelocalhost
with the IP of your machine to see it on another device)
- To share text, simply type in the textarea, and it will be updated in real-time across all connected devices.
- To upload a file, use the file upload form. The uploaded file will be listed and available for download or deletion.
To get the shared text using curl:
curl http://localhost:8088
To write the shared text using curl:
curl -X PUT -d "your text" http://localhost:8088
To list the uploaded files:
curl http://localhost:8088/files
To download a specific file:
curl http://localhost:8088/files/yourfilename.ext --output yourfilename.ext
curl -F "[email protected]" http://localhost:8088/upload
curl -X DELETE http://localhost:8088/files/yourfilename.ext
server.js
: The main server file that sets up the Express server, handles file uploads, deletions, and real-time updates.views/index.ejs
: The main view template for the web interface.uploads/
: The directory where uploaded files are stored.
This project is licensed under the MIT License - see the LICENSE
file for details.
Contributions are welcome! Please fork the repository and submit a pull request.
- Express
- Multer
- Socket.IO
- EJS