Skip to content

⚡ Fast, lightweight & portable HTTP file server with built-in file upload and chat features for Windows.

License

Notifications You must be signed in to change notification settings

c-error/landrive

Repository files navigation

LanDrive

📁 LanDrive is a fast, lightweight, and portable HTTP file server for Windows. logo

Features:

  • 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 in C (low latency & CPU usage).
  • Built-in LAN chat – quickly share links or text with all LAN users.

Demo:

  • Command Prompt Logging: pic1
  • Client Login Interface: pic2
  • Main server Interface: pic3
  • Server Chat Interface: pic4

Usage:

  • Run:
    > drive.exe [port] [pin/pass] [root]
  • Example:
    > drive.exe 80 abc123 C:\server-root-path\
  • Output:
    +- 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 -----------
    ✅ Now you’re ready to go! Open the above URLs in your browser.

Build:

  • 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\
      
  • Verify Installation:

    • Run these commands to confirm:
      > gcc --version
      > g++ --version
      > go version
      
    • If you see version output, your installation was successful 👍
  • Build the Project:

    • Just run build.bat
    • The file drive.exe will appear inside the Source folder.

Project Structure:

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

Contributing:

Feel free to contribute to this project by submitting pull requests or reporting issues. Your contributions are greatly appreciated!

License:

This project is licensed under the MIT License.

😄 Happy coding!

Fun Fact:

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