GithubHelp home page GithubHelp logo

vincent-the-gamer / copy-portal Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 354 KB

Send your clipboard to another device's clipboard.

License: MIT License

TypeScript 100.00%
clipboard remote-desktop

copy-portal's Introduction

Copy Portal

Can't copy text to remote desktop? F**k!!!

Copy Portal - Send your clipboard to another device's clipboard.

Usage

Node.js is required.

  1. Clone this repo to both your device and remote device:
git clone https://github.com/Vincent-the-gamer/copy-portal.git
  1. Install Dependencies
pnpm i
  1. config your links in config.ts
/**
 * server
 */
export const SERVER_HOST = "127.0.0.1"
export const SERVER_PORT = 8080

/**
 * client
 */

// fill in the server address where you've deployed.
// if nginx proxied, fill in your nginx api address.
export const CLIENT_TARGET = "http://localhost:8080"
  1. In remote device, run pnpm run server to start the server.

  2. In your device, to send your current clipboard text, run pnpm run client.

Proxy

Use Nginx + NAT Traversal.

Nginx

Copy the content of nginx.conf to your local nginx config file, and change proxy_pass to your API address.

location /copy-portal {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_method POST;
    proxy_pass http://127.0.0.1:8080/;  # same as SERVER_LINK
}

Expose your local API to NAT

To set up a NAT Traversal, you can use some services like frp + cloud server, sakurafrp or etc.

Then, expose your nginx proxied API to NAT, so that you can send your clipboard to remote device.

License

MIT License | Copyright (c) 2024-present Vincent-the-gamer

copy-portal's People

Stargazers

Cyan avatar

Watchers

Vince G avatar

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.