help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
rust-web-server
RSK World
rust-web-server
Rust Web Server - High-Performance Async Web Server + WebSocket Support + JWT Authentication + File Upload + Memory Safety + Educational Design
rust-web-server
  • .github
  • .vscode
  • benches
  • docs
  • src
  • static
  • tests
  • .dockerignore611 B
  • .editorconfig735 B
  • .env.example676 B
  • .gitignore1.4 KB
  • CHANGELOG.md2 KB
  • CONTRIBUTING.md3.3 KB
  • Cargo.toml1.7 KB
  • Dockerfile1.1 KB
  • LICENSE1.4 KB
  • Makefile2.4 KB
  • README.md7.9 KB
  • SECURITY.md3.2 KB
  • clippy.toml946 B
  • config.toml.example1.3 KB
  • docker-compose.yml380 B
  • rustfmt.toml1.5 KB
config.toml.exampledocker-compose.ymlDockerfile
config.toml.example
Raw Download
Find: Go to:
# Rust Web Server Configuration Example
# Copy this file to config.toml and modify as needed

# Server configuration
host = "127.0.0.1"
port = 8080
static_dir = "static"
workers = 4

# Connection limits
max_connections = 1000
request_timeout_secs = 30
buffer_size = 8192

# Security settings
enable_cors = true
cors_origins = ["http://localhost:3000", "http://localhost:8080"]
rate_limit_requests_per_minute = 100

# Logging
log_level = "info"
log_to_file = false
log_file_path = "logs/server.log"

# Database configuration (if using database features)
[database]
enabled = false
url = "sqlite:server.db"
max_connections = 10

# Authentication configuration
[auth]
enabled = false
jwt_secret = "your-secret-key-here"
token_expiry_hours = 24

# File upload configuration
[file_upload]
enabled = true
max_file_size_mb = 10
allowed_extensions = ["jpg", "jpeg", "png", "pdf", "txt", "zip"]
upload_dir = "uploads"

# WebSocket configuration
[websocket]
enabled = true
max_connections = 100
message_timeout_secs = 30

# Metrics and monitoring
[metrics]
enabled = true
prometheus_port = 9090
collect_system_metrics = true

# SSL/TLS configuration (for HTTPS)
[ssl]
enabled = false
cert_path = "certs/server.crt"
key_path = "certs/server.key"
60 lines•1.3 KB
text
docker-compose.yml
Raw Download
Find: Go to:
version: '3.8'

services:
  rust-web-server:
    build: .
    ports:
      - "8080:8080"
    environment:
      - RUST_LOG=info
    volumes:
      - ./static:/app/static:ro
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
18 lines•380 B
yaml
Dockerfile
Raw Download
Find: Go to:
# Use the official Rust image as the base image
FROM rust:1.75-slim as builder

# Set the working directory
WORKDIR /app

# Copy the Cargo.toml and Cargo.lock files
COPY Cargo.toml Cargo.lock ./

# Copy the source code
COPY src ./src

# Build the application in release mode
RUN cargo build --release

# Use a smaller base image for the final image
FROM debian:bookworm-slim

# Install runtime dependencies
RUN apt-get update && apt-get install -y \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user
RUN useradd -r -s /bin/false rustuser

# Set the working directory
WORKDIR /app

# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/release/server /app/server

# Copy static files
COPY static ./static

# Change ownership of the app directory to the rustuser
RUN chown -R rustuser:rustuser /app

# Switch to the non-root user
USER rustuser

# Expose the port the app runs on
EXPOSE 8080

# Set environment variables
ENV RUST_LOG=info

# Command to run the application
CMD ["./server"]
49 lines•1.1 KB
text

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer