An HTTP server to easily download and upload files.

Overview

httpsweet

An HTTP server to easily download and upload files.

It was created with flexibility in mind, allowing be used in many different situations, therefore in allows deploy the very same operation in many different ways. For more information see the Specification section.

Note: This software is not intended for production enviroment, but for test purposes, therefore be careful with its use, since it don't provide any security mechanism.

Installation

From python packages:

pip3 install httpsweet

From repository:

git clone https://gitlab.com/Zer1t0/httpsweet
cd httpsweet/
python3 setup.py install # required only in case of system installation

Examples

This section show some examples of the common operations.

Download file

Download a file test:

curl 127.0.0.1:8000/test
curl 127.0.0.1:8000/?path=test
curl 127.0.0.1:8000/ -d 'action=download&path=test'

Download part of a file test:

curl '127.0.0.1:8000/test?offset=10&size=20'
curl '127.0.0.1:8000/?offset=10&size=20&path=test'
curl 127.0.0.1:8000/ -d 'action=download&offset=10&size=20&path=test'

Upload file

Upload a file named test_up:

curl 127.0.0.1:8000/test_up -H "Content-Type: application/octet-stream" --data 'thedata' 
curl localhost:8000/test_up -H "Content-Type: application/octet-stream" --data-binary "@/etc/hosts"
curl '127.0.0.1:8000/test_up?action=upload_file&data=thedata'

Upload a file appending:

curl 127.0.0.1:8000/test_app?append=t -H "Content-type: application/octet-stream" --data "thedata"
curl '127.0.0.1:8000/test_app?action=upload_file&data=thedata&append=t'

Upload base64 encoded:

curl 127.0.0.1:8000/test_64?encoding=64 -H 'Content-type: application/octet-stream' --data 'dGhlZGF0YQo=' 
curl '127.0.0.1:8000/?action=upload_file&path=test_64&data=dGhlZGF0YQo&encoding=64'

HTTPS

The server also support the HTTPS protocol, for which you should provide a certificate with a private key, by using the parameters --cert and --key. In case of genereting a cert which also includes the private key, only the --cert parameter must be used.

To generate an auto-self certificate you could use the following command:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
cat key.pem >> cert.pem # generate cert with the private key

Directory listing

By default, directory listing is disabled, in case you want to enable it, you must provide the flag --dir-list.

Specification

The server perform 2 basic actions: download and upload file.

Request Fields

In order to determine the action required in each request, the server examines the following parts of the request:

  • Method
    • POST | PUT :: Indicate upload
    • Rest of methods :: Indicate download
  • Url
    • Url path :: Indicates the path of the desired file
    • Url parameters :: Indicates the action parameters
  • Body, which could be:
    • Raw data :: Indicates the content of the file
    • Url encoded parameters :: Indicates the action parameters
    • Json data :: Indicates the action parameters
  • Headers :: Indicates the action parameters
  • Cookies :: Indicates the action parameters. Since path key has a special meaning in cookies, it is not possible to use that parameter in these fields.

The more relevant parts are those in last positions of the list. That means, for instance, if the Url path indicates the path index.html, but there is a parameter path (in the Url or in the Body) which indicates other_file.txt, then other_file.txt will be selected as the desired path.

Key-Value fields (Url, Body, Headers, Cookies)

In all those fields which can specified the action parameters, the following values can be provided:

  • action: str :: Determines the action
  • path: str :: Indicates the path of the desired file
  • offset: int :: (Download) Indicates the starting point for reading a file
  • size: int :: (Download) Indicates the number of bytes read
  • append: flag :: (Upload) Indicates if the data should be appended to the desired file
  • encoding: str :: Indicates the desired encoder use in the actions, actually only base64 is supported (or not encoder)
  • data: str :: (Upload) The data to write into the desired file

Matching keywords

The key of the key value fields are case-insensitive, then, for instance, is the same offset that Offset or OFFSET.

In the parameter action, any value starting by d (such as d, down, download) will match as download action and any value starting by u (such as u, up, upload) will match as upload action.

You might also like...
Generic automation framework for acceptance testing and RPA

Robot Framework Introduction Installation Example Usage Documentation Support and contact Contributing License Introduction Robot Framework is a gener

A modern API testing tool for web applications built with Open API and GraphQL specifications.
A modern API testing tool for web applications built with Open API and GraphQL specifications.

Schemathesis Schemathesis is a modern API testing tool for web applications built with Open API and GraphQL specifications. It reads the application s

Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

ASGI specification and utilities

asgiref ASGI is a standard for Python asynchronous web apps and servers to communicate with each other, and positioned as an asynchronous successor to

AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.
AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

AirDrive lets you store unlimited files to cloud for free. Upload & download files from your personal drive at any time using its super-fast API.

A telegram bot that can upload telegram media files to anonfiles.com and give you direct download link

✯ AnonFilesBot ✯ Telegram Files to AnonFiles Upload Bot It will Also Give Direct Download Link Process : Fork This Repositry And Simply Cick On Heroku

Simple Telegram Bot to Download and Upload Files From Mega.nz

Mega.nz-Bot Simple Telegram Bot to Download Files From Mega.nz and Upload It to Telegram Features All Mega.nz File Links supported No login required A

A Simple Telegram Bot By @AsmSafone to Download Files From Mega.nz and Upload It to Telegram

MegaDL-Bot A Simple Telegram Bot By @AsmSafone to Download Files From Mega.nz and Upload It to Telegram Features No Login Required All Mega.nz File Li

A Simple Telegram Bot To Download And Upload Files
A Simple Telegram Bot To Download And Upload Files

AquaDLBot ➠ I Can Download And Upload files To Telegram DEMO Copyright (C) 2020-2026 by AsiaXDev@Github DONATE: BUY US A COFFEE CONTACT DEV : Asia DEP

A Simple Telegram Bot that can Download Files From Mega.nz and Upload It to Telegram

MegaDL-Bot A Simple Telegram Bot By @mrkpbots to Download Files From Mega.nz and Upload It to Telegram Features No Login Required All Mega.nz File Lin

 Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Japronto! There is no new project development happening at the moment, but it's not abandoned either. Pull requests and new maintainers are welcome. I

 Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.

Serves some data over HTTP, once. Based on the built-in Python module http.server

serve-me-once Serves some data over HTTP, once. Based on the built-in Python module http.server.

Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.
Django-Audiofield is a simple app that allows Audio files upload, management and conversion to different audio format (mp3, wav & ogg), which also makes it easy to play audio files into your Django application.

Django-Audiofield Description: Django Audio Management Tools Maintainer: Areski Contributors: list of contributors Django-Audiofield is a simple app t

NetMiaou is an crossplatform hacking tool that can do reverse shells, send files, create an http server or send and receive tcp packet
NetMiaou is an crossplatform hacking tool that can do reverse shells, send files, create an http server or send and receive tcp packet

NetMiaou is an crossplatform hacking tool that can do reverse shells, send files, create an http server or send and receive tcp packet

A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool

Privateer A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool How

Download all your URI Online Judge source codes and upload to GitHub with simple steps.
Download all your URI Online Judge source codes and upload to GitHub with simple steps.

URI-Code-Downloader Download all your URI Online Judge source codes and upload to GitHub with simple steps. Prerequisites Python 3.x Installing Downlo

A Telegram bot to download youtube playlists and upload them to telegram. (may be slow becoz youtube limitations)

YTPlaylistDL 📛 A Telegram bot to download youtube playlists and upload them to telegram. (may be slow becoz youtube limitations) 🎯 Follow me and sta

This project calculates current internet upload and download speeds.
This project calculates current internet upload and download speeds.

Internet-Speed-Calculator Project Description: In this project, are creating an internet speed calculator. Requirements: Following modules need to be

Owner
Eloy
Eloy
Python HTTP Server

Python HTTP Server Preview Languange and Code Editor: How to run? Download the zip first. Open the http.py and wait 1-2 seconds. You will see __pycach

SonLyte 16 Oct 21, 2021
Automatically mock your HTTP interactions to simplify and speed up testing

VCR.py ?? This is a Python version of Ruby's VCR library. Source code https://github.com/kevin1024/vcrpy Documentation https://vcrpy.readthedocs.io/ R

Kevin McCarthy 2.3k Jan 1, 2023
HTTP client mocking tool for Python - inspired by Fakeweb for Ruby

HTTPretty 1.0.5 HTTP Client mocking tool for Python created by Gabriel Falcão . It provides a full fake TCP socket module. Inspired by FakeWeb Github

Gabriel Falcão 2k Jan 6, 2023
Waitress - A WSGI server for Python 2 and 3

Waitress Waitress is a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones which live in t

Pylons Project 1.2k Dec 30, 2022
The lightning-fast ASGI server. 🦄

The lightning-fast ASGI server. Documentation: https://www.uvicorn.org Community: https://discuss.encode.io/c/uvicorn Requirements: Python 3.6+ (For P

Encode 6k Jan 3, 2023
livereload server in python (MAINTAINERS NEEDED)

LiveReload Reload webpages on changes, without hitting refresh in your browser. Installation python-livereload is for web developers who know Python,

Hsiaoming Yang 977 Dec 14, 2022
A screamingly fast Python 2/3 WSGI server written in C.

bjoern: Fast And Ultra-Lightweight HTTP/1.1 WSGI Server A screamingly fast, ultra-lightweight WSGI server for CPython 2 and CPython 3, written in C us

Jonas Haag 2.9k Dec 21, 2022
Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)

What's this This is a high performance python wsgi web server. And Meinheld is a WSGI compliant web server. (PEP333 and PEP3333 supported) You can als

Yutaka Matsubara 1.4k Jan 1, 2023
Robyn is an async Python backend server with a runtime written in Rust, btw.

Robyn is an async Python backend server with a runtime written in Rust, btw. Python server running on top of of Rust Async RunTime. Installation

Sanskar Jethi 1.8k Dec 30, 2022
Hypothesis is a powerful, flexible, and easy to use library for property-based testing.

Hypothesis Hypothesis is a family of testing libraries which let you write tests parametrized by a source of examples. A Hypothesis implementation the

Hypothesis 6.4k Jan 1, 2023