Painlessly stream files from one client to another by simply registering a username with a txr-server and sending the files to that listening client.
# to install globally for CLI use anywhere on machine $ npm install -g txr # to install in local repo for library use $ npm install txr
$ # 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!
txr is a CLI utility that provides an easy way to transfer files or directories from one machine to another (i.e. team members, servers, remote machines, etc.) as long as both machines can connect to a txr-server (either locally or on the internet) and have a txr client installed and running. This package contains a server and two client components. The server and clients communicate with each other through the WebSocket protocol to stream files or directories back and forth between clients. Files are never stored anywhere on the server, as it simply acts as a proxy between listening and sending clients.
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 -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 -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