Send files from one computer/server to another easier than you ever have before. As long as both have an internet connection, you can send files to each other.
$ txr listen computer1
# Successfully registered name: computer1. You are now listening for files.
# Starting to receive file with data: {"filename":"file.json","filesizebytes":2048}
# .........
# Finished receiving file with data: {"filename":"file.json","filesizebytes":2048}
# Target file path: /Users/username/file_1593026398451.json
$ txr send computer1 -f ./a/config/file.json
# .........
# All bytes have been read from file: ./a/config/file.json.
# Your file has successfully sent to computer1!
# for CLI use
$ npm install -g txr
# for library use
$ npm install txr
This package hopefully makes it stupid easy to send files to other computers without needing to connect to them via ssh, scp, ftp, or any other protocol that requires some sysadmin and networking skills to setup. This package includes both a client and server component. The server listens for connections from clients and handles sending files to and from each other. Clients can listen for files, send files, and even chat with others all with a single identifier (what we call a "username").
We have a default server listening for connections on Heroku at https://txr.euphoritech.com
, which is what any new client will connect to by default. Files are never stored anywhere on the server since it's basically just serving as a middleman between clients, but feel free to audit the code to confirm. I also encourage you to setup your own server to use offline or in your own secure network if you're passing sensitive data to others and/or have more stringent security requirements.
Ease-of-use and simplicity, period. I'm aware there are already industry standard and well audited tools built for security (ssh, sftp, scp, etc.) to accomplish the same end goal this package serves, but all require a level of sysadmin and networking skills to setup and get running. If I setup a small EC2 machine and want to send a directory of 100 images to it that is on my computer for example, or want to send a coworker and small config file quickly and easily, this package hopefully removes the hoops you would usually have to jump through to get them there.
$ # Connect to the default server (https://txr.euphoritech.com) to listen for files sent to your username
$ txr listen -u myname123
Successfully registered name: myname123. You are now listening for files.
$ # Connect to the default server (https://txr.euphoritech.com) to send the specified file to your listening client
$ txr send -u myname123 -f /path/to/file/to/send
........
All bytes have been read from file: /path/to/file/to/send.
Your file has successfully sent to myname123!
Server: the server listens for clients to connect and manages registering "listener" clients based on a provided username.
Client: There are three types of clients:
As of today, there is a Heroku hobby dyno that has a server waiting for client connections (https://txr.euphoritech.com). If you install this package you can start a listening client with that server without doing anything else other than running the client "listener" command below. If you want to run a txr-server separately than the Heroku dyno, follow instructions below and be sure the point the TXR_HOST environment variable (or -h/--host parameter) of your clients to the appropriate endpoint.
The following are environment variables you can configure to customize your server:
$ txr-server
$ txr-server -p 3000
The following are environment variables you can configure to customize your clients:
$ txr listen yourUniqueUsername
$ txr listen -u yourUniqueUsername
$ txr listen -u yourUniqueUsername -a
$ txr listen -u yourUniqueUsername -h http://localhost:8000
$ txr listen -u yourUniqueUsername -h ws://localhost:8000
$ txr send yourFriendsUniqueUsername -f /local/path/to/file/or/dir
$ txr send -u yourFriendsUniqueUsername -f /local/path/to/file/or/dir
$ txr send -u yourFriendsUniqueUsername -d /local/path/to/file/or/dir
$ txr send -u yourFriendsUniqueUsername -f /local/path/to/file/or/dir -h http://localhost:8000
$ txr send -u yourFriendsUniqueUsername -f /local/path/to/file/or/dir -h ws://localhost:8000
Note: As of today a chat client can only be created if the listener and chatter are using the CLI interface.
$ txr chat -u myUsername -t myFriendsUsername
$ npm run build