STF is a versatile multi-protocol network utility written in Go that provides HTTP file server, SOCKS5 proxy, TCP proxy, HTTP tunnel, and test file generation capabilities in a single binary.
Download from releases or use Docker:
docker run --rm -p 30000:30000 kiyor/stf
git clone https://github.com/kiyor/stf.git
cd stf
go build -v
# Serve current directory on port 30000
./stf
# Serve specific directory on custom port
./stf -d /path/to/files -p :8080
# Enable file uploads
./stf -uploadonly
Access your server at http://localhost:30000
# Basic SOCKS5 proxy
./stf -socks5 -p :1080
# With authentication
echo "user:password" > auth.txt
./stf -socks5 -socks5auth auth.txt -p :1080
# Configure your applications to use SOCKS5 proxy at localhost:1080
# Start HTTP tunnel
./stf -tunnel -p :8888
# Configure applications to use HTTP proxy at localhost:8888
The default mode serves files from a directory with optional upload capability.
# Serve current directory
./stf
# Serve specific directory
./stf -d /var/www/html
# Custom port
./stf -p :8080
# Disable gzip compression
./stf -gzip-disable
# Enable upload-only mode (only POST/PUT requests)
./stf -uploadonly
# Upload files using curl
curl -X POST -F "[email protected]" http://localhost:30000/upload
# Simple user:password format
./stf -httpauth "user:secret123"
# From file (one user:pass per line)
echo -e "admin:password\nuser:123456" > auth.txt
./stf -httpauth auth.txt
# JSON format
echo '{"users": {"admin": "secret", "user": "pass"}}' > auth.json
./stf -httpauth auth.json
# Allow specific IP ranges
./stf -allow 192.168.1.0/24 -allow 10.0.0.1
# Deny specific IPs
./stf -deny 1.2.3.4 -deny 5.6.7.8
# Custom timeout (default 5 minutes)
./stf -timeout 10m
# Disable timeout
./stf -notimeout
# Verbose logging
./stf -v # Basic verbose
./stf -vv # Very verbose (includes request/response body)
./stf -body # Show request/response body content
./stf -c # Colorful output
# Debug responses
./stf -return 404 # Always return 404
./stf -3xx "301 https://example.com" # Redirect all requests
# Custom gzip types
./stf -gzip-types "text/html application/json"
Every directory can be opened in a built-in, ACDSee-style photo browser — no extra flags,
the page is embedded in the binary. The plain listing shows a Gallery (N) link when the
folder contains images, or append ?gallery to any directory URL:
./stf -d ~/Pictures
open "http://localhost:30000/?gallery"
+/-/0/1, R, I, T, F, S, Esc, Backspace (press ? in the page)/photos/?gallery#view=IMG_0001.jpg; browser Back closes the viewer<image>?thumb=256 returns a JPEG (longest edge 32–1600, EXIF orientation applied,
128 MB in-memory LRU, ETag/304). JPEG/PNG/GIF/WebP/BMP are thumbnailed; SVG/AVIF/HEIC fall back to the original?gallery=json returns the folder listing as JSON; -noindex disables the gallery like the listingSTF provides a full-featured SOCKS5 proxy server with authentication and rate limiting.
# Start SOCKS5 proxy on port 1080
./stf -socks5 -p :1080
# Custom port
./stf -socks5 -p :9050
# File-based auth (username:password per line)
echo -e "user1:pass1\nuser2:pass2" > socks_auth.txt
./stf -socks5 -socks5auth socks_auth.txt
# JSON format
echo '{"users": {"proxy_user": "secret123"}}' > socks_auth.json
./stf -socks5 -socks5auth socks_auth.json
# Limit upload to 1MB/s, download to 5MB/s
./stf -socks5 -socks5in 1048576 -socks5out 5242880
# No upload limit, 10MB/s download limit
./stf -socks5 -socks5out 10485760
# Chain through another SOCKS5 proxy
./stf -socks5 -socks5next upstream.proxy.com:1080
# Chain with authentication
./stf -socks5 -socks5next proxy.com:1080:user:pass
# Disable DNS resolution (let upstream handle it)
./stf -socks5 -socks5next proxy.com:1080 -socks5noresolver
# Custom hosts resolution
echo -e "example.com 127.0.0.1\ntest.local 192.168.1.100" > hosts.txt
./stf -socks5 -socks5hosts hosts.txt
Forward raw TCP connections to an upstream server.
# Proxy TCP connections to backend server
./stf -upstream backend.example.com:3306 -p :3306
# Proxy with IP restrictions
./stf -upstream 10.0.0.100:5432 -allow 192.168.1.0/24 -p :5432
Create an HTTP CONNECT tunnel proxy for HTTPS and other protocols.
# Start HTTP tunnel proxy
./stf -tunnel -p :8888
# With authentication
./stf -tunnel -httpauth "proxy_user:secret" -p :8888
# Configure applications to use HTTP proxy at localhost:8888
Automatically forward HTTP and HTTPS traffic to different upstream servers.
# Forward to single backend (auto-detects HTTP/HTTPS)
./stf -bridge backend.internal.com
# Forward HTTP to one server, HTTPS to another
./stf -bridge "http.internal.com:https.internal.com"
# Custom ports
./stf -bridge "internal.com:192.168.1.100" -p :80
# With SSL certificates for HTTPS termination
./stf -bridge internal.com -crt server.crt -key server.key
Generate files of specific sizes for bandwidth and performance testing.
# Enable test file generation
./stf -testfile -p :8080
# Access test files:
# http://localhost:8080/1K - 1 kilobyte file
# http://localhost:8080/10M - 10 megabyte file
# http://localhost:8080/1G - 1 gigabyte file
# Custom cache control
./stf -testfile -testcc "no-cache"
# Enable bandwidth counter
./stf -testfile -testc
# With HTTP Range support for partial downloads
curl -H "Range: bytes=0-1023" http://localhost:8080/10M
/1K to /999K - Kilobyte files/1M to /999M - Megabyte files/1G to /999G - Gigabyte files/1T to /999T - Terabyte files# Production web server with auth and security
./stf -d /var/www \
-p :80 \
-httpauth auth.txt \
-allow 0.0.0.0/0 \
-deny 192.168.100.0/24 \
-timeout 30m \
-v
# SOCKS5 proxy with rate limiting and auth
./stf -socks5 \
-p :1080 \
-socks5auth corporate_users.txt \
-socks5in 5242880 \
-socks5out 10485760 \
-allow 192.168.0.0/16 \
-v
# Test server with uploads and test files
./stf -d ./public \
-uploadonly \
-testfile \
-testc \
-p :3000 \
-vv \
-c
# Bridge mode for load balancing
./stf -bridge "app1.internal:app2.internal" \
-p :80 \
-allow 10.0.0.0/8 \
-timeout 60s \
-v
# Serve current directory
docker run --rm -p 30000:30000 -v $(pwd):/data kiyor/stf -d /data
# With custom configuration
docker run --rm -p 8080:8080 -v $(pwd):/data kiyor/stf -d /data -p :8080 -uploadonly
# SOCKS5 proxy with authentication
echo "user:pass" > auth.txt
docker run --rm -p 1080:1080 -v $(pwd)/auth.txt:/auth.txt kiyor/stf -socks5 -socks5auth /auth.txt -p :1080
version: '3.8'
services:
stf:
image: kiyor/stf
ports:
- "30000:30000"
volumes:
- ./files:/data
- ./auth.txt:/auth.txt
command: [-d, /data, -httpauth, /auth.txt, -uploadonly, -v]
restart: unless-stopped
# Basic request logging
./stf -v
# Detailed request/response logging
./stf -vv
# Log to file with timestamps
./stf -v 2>&1 | tee stf.log
# Dump requests to /tmp/stfdump/ (with -v or -vv)
./stf -vv # Creates detailed dumps in /tmp/stfdump/
# Monitor connections and bandwidth
./stf -socks5 -v # Shows connection statistics
# Restrict access to trusted networks
./stf -allow 192.168.1.0/24 -allow 10.0.0.0/8 -deny 0.0.0.0/0
# Use reasonable timeouts
./stf -timeout 5m
# Serve specific directory only
./stf -d /var/www/public
# Enable authentication for sensitive content
./stf -httpauth "admin:$(openssl rand -base64 32)"
Port already in use:
# Check what's using the port
sudo netstat -tlnp | grep :30000
# Use different port
./stf -p :30001
Permission denied:
# For ports < 1024, run as root or use higher port
sudo ./stf -p :80
# or
./stf -p :8080
Connection timeouts:
# Increase timeout or disable it
./stf -timeout 10m
# or
./stf -notimeout
File upload issues:
# Ensure upload mode is enabled and directory is writable
./stf -uploadonly -d /tmp/uploads
chmod 755 /tmp/uploads
# Enable maximum verbosity
./stf -vv -body -c
# Check configuration
./stf -version
# Monitor real-time logs
./stf -v | grep -E "(ERROR|WARN|INFO)"
# Log to file with rotation
./stf -v 2>&1 | rotatelogs stf_%Y%m%d.log 86400
git checkout -b feature/amazing-featuregit commit -m 'Add amazing feature'git push origin feature/amazing-featureThis project is licensed under the MIT License - see the LICENSE file for details.
github.com/NYTimes/gziphandler for compressiongithub.com/kiyor/go-socks5github.com/juju/ratelimitSTF - Simple, powerful, versatile. One binary, multiple protocols. 🚀
Content type
Image
Digest
sha256:a84bd944d…
Size
8 MB
Last updated
24 days ago
docker pull kiyor/stf