Skip to content
drisul10Public

About

Simple and elegant local network clipboard sharing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

locopy

Simple and elegant local network clipboard sharing. Copy text and files between devices on the same network via a beautiful web interface.

✨ Features

  • ✨ Simple & Elegant: Clean, modern UI with delightful interactions
  • 🔒 Private & Secure: Only works on your local network
  • ⚡ Fast & Real-time: Instant clipboard sharing via WebSocket
  • 📋 Text Sharing: Copy and paste text between devices
  • 📎 File Sharing: Send and receive files up to 100MB
  • 🌐 Cross-platform: Works on all major browsers and operating systems
  • 📱 Responsive: Optimized for desktop, tablet, and mobile devices
  • 🌙 Dark/Light Mode: Beautiful gold theme with dark mode by default
  • 📊 Device Tracking: See all connected devices with their IP addresses
  • 💾 History: Keep track of recent clipboard items
  • 🚀 Offline Ready: All assets are local, no CDN dependencies

📋 Requirements

  • Node.js 14.x or higher
  • npm or yarn
  • Devices connected to the same local network

🚀 Installation

  1. Clone or download this repository

    git clone <repository-url>
    cd locopy
  2. Install dependencies

    npm install

🎯 Usage

Starting the Server

Start the locopy server:

npm start

Or for development with auto-reload:

npm run dev

The server will start on port 5555 and display all available network IPs:

🚀 locopy server running on port 5555

Access locopy at:
   http://192.168.1.100:5555
   http://localhost:5555

Accessing from Devices

  1. On the server machine: Open http://localhost:5555 in your browser
  2. On other devices: Open http://[server-ip]:5555 (use the IP shown when server starts)

Using locopy

Sending Text

  1. Type or paste text in the "Text to Copy" field
  2. Click "Send Text" button
  3. The text will appear on all connected devices and be automatically copied to their clipboard

Sending Files

  1. Click "Choose files or drag and drop" or drag files directly
  2. Select one or multiple files (up to 100MB each)
  3. Click "Send File" button
  4. Files will be available for download on all connected devices

Receiving Content

  • Received text is automatically copied to your clipboard
  • Received files can be downloaded with a single click
  • All received items are saved in "Recent Items" for quick access

Managing History

  • Click any item in "Recent Items" to copy/download it again
  • Click the × button on any item to delete it
  • Click "Clear All" to remove all history

Theme Toggle

  • Click the moon/sun icon in the top-right to switch between dark and light modes
  • Your preference is saved automatically

🌐 Network Access

The server automatically detects all available network interfaces and displays their IP addresses when starting. Access locopy from any device on the same network using:

http://[your-server-ip]:5555

Common IP ranges:

  • 192.168.x.x - Most home networks
  • 10.0.x.x - Some corporate networks
  • 172.16.x.x - Some networks

📁 Project Structure

locopy/
├── public/              # Frontend files
│   ├── index.html      # Main HTML file
│   ├── styles.css      # Stylesheet
│   ├── app.js          # Frontend JavaScript
│   ├── fonts/          # Local font files
│   │   └── fonts.css   # Font definitions
│   └── lib/            # Third-party libraries
│       └── lucide.js   # Icon library
├── server.js           # Express server with WebSocket
├── package.json        # Dependencies and scripts
├── .gitignore         # Git ignore rules
└── README.md          # This file

🔧 Configuration

Port

Default port is 5555. You can change it using environment variables:

Option 1: Using .env file (recommended)

  1. Copy .env.example to .env:
    cp .env.example .env
  2. Edit .env and set your desired port:
    PORT=8080

Option 2: Using environment variable Set the PORT environment variable before starting the server:

Linux/macOS:

export PORT=8080
npm start

Windows (Command Prompt):

set PORT=8080
npm start

Windows (PowerShell):

$env:PORT=8080
npm start

One-liner (all platforms):

PORT=8080 npm start

File Size Limit

Default file size limit is 100MB. To change it, edit the multer configuration in server.js:

limits: {
  fileSize: 100 * 1024 * 1024, // Change to your desired limit
}

🔒 Security

  • Local Network Only: Only accessible on your local network
  • No External Dependencies: All assets are served locally
  • File Validation: Dangerous file types are blocked
  • Path Traversal Protection: Secure file download handling
  • Auto-cleanup: Temporary files are deleted after 1 hour

🛠️ Development

Scripts

  • npm start - Start the production server
  • npm run dev - Start development server with auto-reload (requires nodemon)

Dependencies

  • express - Web server framework
  • ws - WebSocket library for real-time communication
  • multer - File upload handling
  • cors - CORS middleware

Development Dependencies

  • nodemon - Auto-reload during development

📱 Browser Support

  • Chrome/Edge (latest)
  • Firefox (latest)
  • Safari (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

🐛 Troubleshooting

Can't connect from other devices

  • Ensure all devices are on the same network
  • Check firewall settings (port 5555 must be open)
  • Verify the server IP address is correct
  • Try accessing via IP instead of hostname

Files not downloading

  • Check browser download settings
  • Ensure pop-ups aren't blocked
  • Verify file hasn't been auto-deleted (1 hour limit)

WebSocket connection issues

  • Refresh the page
  • Check browser console for errors
  • Verify server is running and accessible

Theme not saving

  • Check browser localStorage is enabled
  • Clear browser cache and try again

📝 License

MIT

🙏 Acknowledgments

  • Built with Express.js and WebSocket
  • Icons by Lucide
  • Fonts: Nunito and Inter

📞 Support

For issues, questions, or contributions, please open an issue on the repository.


Enjoy seamless clipboard sharing across your devices! 🎉

About

Simple and elegant local network clipboard sharing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages