GoHTTP

command module
v0.0.0-...-9ec2a4c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2025 License: Unlicense Imports: 1 Imported by: 0

README

GoHTTP

A simple HTTP file server that allows browsing directories and uploading files via a web interface or command line tools.

Features

  • Serve files from a specified directory
  • Support for file uploads and downloads
  • Basic authentication for secure access
  • Upload files via the web interface or with curl
  • TLS encryption with either provided certificates or auto-generated self-signed certificates

Installation

Using Go
go install github.com/Gubarz/GoHTTP@latest
From Source
git clone https://github.com/Gubarz/GoHTTP.git 
cd GoHTTP 
go build

Usage

Basic Server

Start a basic server on port 8080 serving the current directory:

GoHTTP
Command Line Options
Usage: GoHTTP [flags]

Flags: 
-a, --auth string Optional basic auth in user:pass format 
-c, --cert string TLS cert file (optional) 
-d, --dir string Base directory to serve (default ".") 
-h, --help help for GoHTTP 
-k, --key string TLS key file (optional) 
-p, --port string Port to listen on (default "8080") 
-t, --tls Enable HTTPS (self-signed if cert/key not provided)

Examples

Serve a Specific Directory on a Custom Port
GoHTTP --dir /path/to/serve --port 9000
Enable Basic Authentication
GoHTTP --auth username:password
Use TLS with Auto-Generated Certificates
GoHTTP --tls
Use TLS with Custom Certificates
GoHTTP --tls --cert mycert.pem --key mykey.pem

File Uploads

Via Web Interface

Navigate to any directory in your browser and use the upload form at the bottom of the page.

Via Command Line

Upload a file using curl:

curl -F '[email protected]' http://localhost:8080/

With authentication:

curl -F '[email protected]' -u username:password http://localhost:8080/

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL