SkillAgentSearch skills...

Sweb

A small web http&https server for test and upload file. Also support webdav and socks5/http/https proxy . Just one file to serve. Use golang and AI auto program.

Install / Use

/learn @twhite-gh/Sweb
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

🌐 Simple Web File Server v0.0.5

A lightweight Web file server written in Go, supporting static file serving, file upload, file browsing, WebDAV protocol, HTTPS encrypted connection, SOCKS5 proxy, HTTP proxy, and HTTPS proxy services. Supports bilingual interface (Chinese/English), with automatic switching based on browser language or manual selection.

✨ Project Features

  • 🚀 Zero-Configuration Startup - Ready to use out of the box, automatically creates the necessary directory structure.
  • 🔒 Security First - Advanced features are disabled by default and must be explicitly enabled via command-line arguments.
  • 🔐 Authentication Support - WebDAV, HTTP Proxy, HTTPS Proxy, and SOCKS5 Proxy support Basic authentication to protect service security.
  • 📂 File Browsing - Dedicated file browsing page, supports drag-and-drop multiple file uploads and progress display.
  • 🌐 WebDAV Support - Complete WebDAV protocol implementation, supporting remote file management and authentication.
  • 🔐 HTTPS Encryption - Supports SSL/TLS encrypted connections, ensuring data transfer security.
  • 🌐 Proxy Services - Supports SOCKS5, HTTP, and HTTPS proxies, protected by Basic authentication.
  • 📱 Real-time Status - Dynamically displays feature status, supports hot updates.
  • 🎨 Modern Interface - Responsive design, supports bilingual interface (Chinese/English).
  • 🌍 Multilingual Support - Automatic switching based on browser language, supports manual language selection.
  • ⚙️ Flexible Configuration - Supports HTTP service switch, allowing only HTTPS or proxy services to be enabled.

📋 Key Features

📁 Static File Serving

Automatically serves all files in the web directory, supporting various file types like HTML, CSS, JavaScript, images, etc.

📤 File Upload

  • Supports drag-and-drop multiple file uploads to the Web interface.
  • Displays real-time upload progress bar.
  • Supports various file formats.
  • Security consideration: Disabled by default, requires explicit enabling.

📂 File Browsing

  • Dedicated file browsing page, displaying all files in the web directory.
  • Supports file type icon recognition and online preview.
  • Clicking a file directly downloads it; displays file size and modification time.
  • Security consideration: Disabled by default, requires explicit enabling.

🌐 WebDAV Service

  • Complete WebDAV protocol support (RFC 4918).
  • Runs on an independent port: Default port is 8081, not shared with the HTTP service.
  • Supports both read/write and read-only modes.
  • Configurable mount directory and custom port.
  • Supports Basic authentication protection (Default username/password: webdav/webdav).
  • Compatible with various WebDAV clients, with special optimization for Windows client compatibility.
  • Fixes for Windows WebDAV client authentication, supporting network drive mapping.
  • Independent WebDAV information page, displaying service status and mounting instructions.

🔐 HTTPS Service

  • Supports SSL/TLS encrypted connections.
  • Automatically loads certificate files from the cert directory.
  • Provides both HTTP and HTTPS services simultaneously.
  • Real-time display of certificate status.

🔧 Automatic Configuration

Automatically creates the necessary directory structure, making it usable without manual configuration.

🚀 Quick Start

Download and Installation

  1. Download the executable file suitable for your system from the [可疑链接已删除] page.
  2. Alternatively, compile from source:
    git clone <repository-url>
    cd sweb
    
    # Use the build script to compile for all platforms
    # Windows
    build.bat
    
    # Linux/macOS
    make all
    
    # Or manually compile (including all source files)
    go build -o sweb.exe ./src/main.go ./src/upload.go ./src/files.go ./src/webdav.go ./src/server.go ./src/utils.go ./src/socks5.go ./src/proxy.go ./src/https_proxy.go
    

Basic Usage

# Start the basic file server
./sweb.exe

# Enable file upload feature
./sweb.exe -upload

# Enable file browsing feature
./sweb.exe -files

# Enable WebDAV service
./sweb.exe -webdav

# Enable WebDAV service and turn on authentication (default port 8081)
./sweb.exe -webdav -webdav-auth

# Enable WebDAV service and specify a custom port
./sweb.exe -webdav -webdav-port 8082

# Enable HTTPS service
./sweb.exe -https

# Enable SOCKS5 proxy service
./sweb.exe -socks5

# Enable HTTP proxy service
./sweb.exe -proxy

# Enable SOCKS5 proxy service and turn on authentication
./sweb.exe -socks5 -socks5-auth

# Enable HTTP proxy service and turn on authentication
./sweb.exe -proxy -proxy-auth

# Enable HTTPS proxy service
./sweb.exe -https-proxy

# Enable HTTPS proxy service and turn on authentication
./sweb.exe -https-proxy -https-proxy-auth

# Only enable HTTPS service (turn off HTTP)
./sweb.exe -http=false -https

# Enable all features
./sweb.exe -upload -files -webdav -webdav-auth -https -socks5 -proxy -proxy-auth -https-proxy -https-proxy-auth

# View Chinese help information (default)
./sweb.exe -help

# View English help information
./sweb.exe -help-lang en -help

# Specify port
./sweb.exe -port 9000

# View help
./sweb.exe -help

📖 Command Line Arguments

| Parameter | Shorthand | Description | Default Value | | :--- | :--- | :--- | :--- | | --enable-upload | -upload | Enable file upload feature | Disabled | | --enable-files | -files | Enable file browsing feature | Disabled | | --enable-webdav | -webdav | Enable WebDAV service | Disabled | | --webdav-dir | | Root directory for WebDAV service | Current directory | | --webdav-port | | WebDAV server port | 8081 | | --webdav-readonly | | WebDAV service read-only mode | Read/Write mode | | --webdav-auth | | Enable WebDAV authentication | Disabled | | --webdav-username | | WebDAV authentication username | webdav | | --webdav-password | | WebDAV authentication password | webdav | | --enable-http | -http | Enable HTTP service | Enabled | | --https | | Enable HTTPS service | Disabled | | --enable-socks5 | -socks5 | Enable SOCKS5 proxy service | Disabled | | --socks5-auth | | Enable SOCKS5 proxy authentication | Disabled | | --socks5-username | | SOCKS5 proxy authentication username | socks5 | | --socks5-password | | SOCKS5 proxy authentication password | socks5 | | --enable-proxy | -proxy | Enable HTTP proxy service | Disabled | | --proxy-auth | | Enable HTTP proxy authentication | Disabled | | --proxy-username | | HTTP proxy authentication username | http | | --proxy-password | | HTTP proxy authentication password | http | | --enable-https-proxy | -https-proxy | Enable HTTPS proxy service | Disabled | | --https-proxy-auth | | Enable HTTPS proxy authentication | Disabled | | --https-proxy-username | | HTTPS proxy authentication username | https | | --https-proxy-password | | HTTPS proxy authentication password | https | | --port | -p | HTTP server port | 8080 | | --https-port | | HTTPS server port | 8443 | | --socks5-port | | SOCKS5 proxy port | 1080 | | --proxy-port | | HTTP proxy port | 10808 | | --https-proxy-port | | HTTPS proxy port | 10443 | | --cert-dir | | SSL certificate directory | ./cert | | --help-lang | | Help message language (zh/en) | zh | | --help | -h | Display help information | |

📂 File Browsing Feature

Enabling File Browsing

# Enable file browsing feature
./sweb.exe -files

# Enable both file browsing and upload
./sweb.exe -files -upload

Feature Characteristics

  • File List: Grid layout displaying all files, supports file type icons.
  • File Information: Displays file size, modification time, and file type.
  • Online Download: Clicking a file directly downloads it.
  • Real-time Refresh: Supports manual refreshing of the file list.

🌐 WebDAV Usage Guide

Enabling WebDAV Service

# Basic enablement (default port 8081)
./sweb.exe -webdav

# Specify directory and port
./sweb.exe -webdav -webdav-dir /path/to/files -webdav-port 8082

# Read-only mode
./sweb.exe -webdav -webdav-readonly

# Enable authentication
./sweb.exe -webdav -webdav-auth

# Full configuration example
./sweb.exe -webdav -webdav-auth -webdav-port 8082 -webdav-dir ./data

Client Connection

Windows System

  1. Open File Explorer.
  2. Right-click "This PC" → "Map network drive".
  3. Enter the address: http://localhost:8081/webdav (default port).
  4. If authentication is enabled, enter username: webdav, password: webdav.

macOS System

  1. Open Finder.
  2. Press Cmd + K or select "Go" → "Connect to Server".
  3. Enter the address: http://localhost:8081/webdav (default port).
  4. If authentication is enabled, enter username: webdav, password: webdav.

Linux System

# Install davfs2
sudo apt-get install davfs2

# Mount WebDAV (default port)
sudo mount -t davfs http://localhost:8081/webdav /mnt/webdav

# If authentication is enabled, you will be prompted for username and password

Mobile Devices

Use file management applications that support WebDAV:

  • iOS: Documents by Readdle, FileBrowser
  • Android: Solid Explorer, FX File Explorer

🔐 HTTPS Usage Guide

Enabling HTTPS Service

# Enable HTTPS service
./sweb.exe -https

# Specify certificate directory
./sweb.exe -https -cert-dir /path/to/certs

# Specify ports
./sweb.exe -https -http-port 8080 -https-port 8443

Certificate Configuration

  1. Create a cert folder in the current directory.
  2. Place SSL certificate files into the cert directory:
    • server.crt - Certifi

Related Skills

View on GitHub
GitHub Stars108
CategoryCustomer
Updated2mo ago
Forks0

Languages

Go

Security Score

85/100

Audited on Jan 29, 2026

No findings