Back to Project List

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

Topology Diagram

  1. UI initiates a send (from the Host machine)
  2. Host machine talks to the HTTP server of the Client machine, asking for an open TCP port
  3. Client UI tells the Client HTTP server to open the TCP port
  4. Client HTTP server queries to open a TCP port
  5. Client HTTP server retrieves the opened port number
  6. Client HTTP server sends the port number to Host HTTP server
  7. Host HTTP server queries to send the file to the retrieved port
  8. 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 daemon
    • daemon/server.py contains the code for the HTTP server written in Flask
    • daemon/net/ contains all the TCP network code
      • daemon/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)
Ruturaj Mohite
Ishan Shanware

Cli is ready

November 14, 2021

Daemon HTTP server now is able to accept requests for recving, sending and polling for progress

November 14, 2021

Daemon HTTP server can now accept requests to recieve files.

November 14, 2021

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

November 14, 2021

Project created by Ruturaj Mohite

November 14, 2021