Skip to content

User manual

Mateo Monsalve Valencia edited this page Sep 22, 2024 · 2 revisions

Table of Contents

  1. Editing Configuration Files
  2. Setting Up the Server
  3. Setting Up Peer Servers
  4. Using the Peer Client

Editing Configuration Files

Server Configuration

The server configuration is stored in config.yaml. Open the file and edit the following fields as needed:

control:
  port: 8000 # Port to listen for incoming control messages
peer:
  port: 8001 # Port to listen for incoming data to

 request

 data
auth:
  token: "secret" # Token to authenticate

Peer Configuration

The peer configuration is also stored in config.yaml. Open the file and edit the following fields as needed:

ip: 107.23.96.211
port: 8000 # Port to listen for incoming control messages
peer:
  port: 8001 # Port to listen for incoming data or to request data
  path: "./files/" # Path of the directory to share
auth:
  token: "secret" # Token to authenticate

Setting Up the Server

  1. Install Dependencies: Ensure you have Python 3 installed. Install required packages using:

    pip install -r requirements.txt
  2. Run the Server: Navigate to the server directory and run the server:

    python3 server.py

Setting Up Peer Servers

  1. Install Dependencies: Ensure you have Python 3 installed. Install required packages using:

    pip install -r requirements.txt
  2. Run the Peer Server: Navigate to the peer directory and run the peer server:

    python3 peer.py --server

Using the Peer Client

  1. Install Dependencies: Ensure you have Python 3 installed. Install required packages using:

    pip install -r requirements.txt
  2. Run the Peer Client: Navigate to the peer directory and run the peer client:

    python3 peer.py
  3. CLI Commands:

    • Help:
      help
    • Connect to Server:
      connect [-h host] [-p port] [-t token]
      If no host, port, and token are given, the values in the configuration file will be used.
    • Disconnect from Server:
      disconnect
    • List Files:
      list
    • Get File Address:
      where [-f file]
    • Retrieve File:
      get [-f file] [-o output]
    • Exit Program:
      exit

Example Usage

  1. Connect to Server:

    connect -h 127.0.0.1 -p 8000 -t secret
  2. List Files:

    list
  3. Get File Address:

    where -f example.txt
  4. Retrieve File:

    get -f example.txt -o ./downloads/example.txt
  5. Disconnect from Server:

    disconnect
  6. Exit Program:

    exit

Clone this wiki locally