DirectTransfer
Send and recv files with people around you with ease and speed
Repository Video ▶️DirectTransfer
Send and recv files with people around you with ease and speed
DirectTransfer provides an easy way to share files with people around you or on the current network. It uses TCP over sockets to transfer files and folders, completely peer to peer. The aim of DirectTransfer is for user to be able to share files with as less clicks/keypresses as possible and quick.
Topology
- UI initiates a send (from the Host machine)
- Host machine talks to the HTTP server of the Client machine, asking for an open TCP port
- Client UI tells the Client HTTP server to open the TCP port
- Client HTTP server queries to open a TCP port
- Client HTTP server retrieves the opened port number
- Client HTTP server sends the port number to Host HTTP server
- Host HTTP server queries to send the file to the retrieved port
- Host sends the file to the Client through the now established TCP connection
As a user, there are two ways I can send files:
A send is initiated by me to a client, the client accepts the file I expose an index of files that client can request from me, the client requests a file and I send it to them.
It consists of two parts:
Daemon: A simple HTTP server. All core network function calls are initiated by this server.
UI: talks to the daemon server for any actions.
Usage
CLI
DirectTransfer provides a simple Command Line Interface to send files
python ui/cli/cli.py
Usage: cli.py [OPTIONS] ACTION
Actions:
send: Send files to a client
receive: Listen for files and reveive them
Options:
-c TEXT (send only) Client IP
-p TEXT File or directory path
--help Show this message and exit.
Code
daemon/
contains all the code related to the daemondaemon/server.py
contains the code for the HTTP server written in Flaskdaemon/net/
contains all the TCP network codedaemon/net/asclient.py
contains code for peer acting as a client (recieving files)daemon/net/ashost.py
contains code for peer acting as a host (sending files)
Cli is ready
Daemon HTTP server now is able to accept requests for recving, sending and polling for progress
Daemon HTTP server can now accept requests to recieve files.
Added TCP (with sockets) functions to the daemon, now able to transfer files over network using the TCP functions. Next step is to finish up the daemon server
Project created by Ruturaj Mohite