π LanDrive is a fast, lightweight, and portable HTTP file server for Windows.
- Portable β single
.exe
file, no installation required. - Zero dependencies β no third-party libraries used.
- Multi-file upload β upload several files at once.
- Direct streaming β files are streamed directly to disk (low memory usage).
- IP-based authentication β fast and effective for most LAN setups.
- Scalable directory listing β efficiently lists
>5000
files/folders inC
(low latency & CPU usage). - Built-in LAN chat β quickly share links or text with all LAN users.
- Run:
> drive.exe [port] [pin/pass] [root]
- Example:
> drive.exe 80 abc123 C:\server-root-path\
- Output:
β Now youβre ready to go! Open the above URLs in your browser.
+- LanDrive ------- | root: C:\server-root-path\ ... | port: 80 ... | pass: abc123 ... +------------------ | url: http://127.0.0.1:80/path?fo=/ ... | url: http://192.168.0.200:80/path?fo=/ ... +- Logs -----------
-
Install Dependencies:
- Download and install MSYS2.
- Open the mingw64.exe shell (from the MSYS2 Start Menu).
- Run the following commands:
$ pacman -Syu # Update system packages (MSYS2 may restart) $ pacman -Syu # Run again after restart $ pacman -S --needed base-devel mingw-w64-x86_64-toolchain $ pacman -S mingw-w64-x86_64-go
-
Set Environment Variables:
- Open the Environment Variables:
> rundll32.exe sysdm.cpl,EditEnvironmentVariables # run in Command Prompt
- Add the following paths to your Path variable:
C:\msys64\mingw64\bin\ C:\msys64\usr\bin\
- Open the Environment Variables:
-
Verify Installation:
- Run these commands to confirm:
> gcc --version > g++ --version > go version
- If you see version output, your installation was successful π
- Run these commands to confirm:
-
Build the Project:
- Just run
build.bat
- The file
drive.exe
will appear inside the Source folder.
- Just run
The project has the following structure:
.
β
βββ build.bat
βββ color.png
βββ go.mod
βββ html.go
βββ h_chat.go
βββ h_get.go
βββ h_login.go
βββ h_path.go
βββ h_set.go
βββ icon.ico
βββ icon.rc
βββ LICENSE
βββ main.go
βββ README.md
βββ banner.png
β
ββββ demo
β βββ pic_1.png
β βββ pic_2.png
β βββ pic_3.png
β βββ pic_4.png
β
ββββ embed
β βββ ansi.c
β βββ chat.js
β βββ login.js
β βββ main.c
β βββ main.css
β βββ main.js
β βββ main.png
β
ββββ font
βββ CourierPrime-Bold.ttf
βββ CourierPrime-BoldItalic.ttf
βββ CourierPrime-Italic.ttf
βββ CourierPrime-Regular.ttf
βββ OFL.txt
Feel free to contribute to this project by submitting pull requests or reporting issues. Your contributions are greatly appreciated!
This project is licensed under the MIT License.
π Happy coding!
If you visit the /echo
endpoint, for example:
the server will respond by echoing back the full client request:
GET /echo HTTP/1.1
Host: 127.0.0.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Dnt: 1
Priority: u=0, i
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
Sec-Fetch-User: ?1
Sec-Gpc: 1
Upgrade-Insecure-Requests: 1