Skip to content

sn123/red

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Red

Red is a lightweight webserver for quick file sharing between systems on same network. Red is also a static web server and can help in quickly hosting any folder and making it accessible on the intranet. Red also has very basic support for SPAs (Single Page Apps) by supporting a fallback to / for all 404s.

It works well for accessing & downloading files from the system to the phone on the same network.

Binaries can be downloaded from releases page.

How it works

Copy over the red server into any folder that should be red-ified. Starting 1.2, Red supports "Red-ifying" any folder by passing it as an argument (see running from source section below). There's a basic Explorer context menu integration (for now Windows only), right-clicking on any folder shows an option to "Redify" which would spawn red serving that folder. A powershell script is provided as part as 1.2 to make respective registry entries, open powershell:

PS c:\red-path> Unblock-File -Path install.ps1
PS c:\red-path> .\install.ps1

Run red, once Red starts it will automatically find the next available port and outbound IP address and will print the QR code on console which can be scanned by the phones to navigate to the server.

Since red relies on Golang's built-in behavior, having an index.html file in the root of the folder would cause it to serve the index file instead of showing directory content (https://golang.org/src/net/http/fs.go). It tries to hijack the default html generated to make it more responsive.

Run

On the phone, point your camera to the QR code

Phone

Running from source

$ go build
$ ./red --path=folder-to-redify --port= --fs=true|false
### Build from source
$ go build -ldflags="-s -w" ./

Command line Parameters

  • path: Path to redify, default: current folder
  • port: Port to listen on, default: random available port
  • fs: fallback to serve default root file (index.html), default: false

Building different architecture

PS :> $env:GOOS = "linux"
PS :>$env:GOOS = "darwin"