SimpleWWWServer

User Guide

Overview

What is SimpleWWWServer?

SimpleWWWServer is a powerful tool for developers to create custom mock servers. It allows you to simulate APIs and test your applications without relying on backend services.

Main Features

  • Create custom API endpoints
  • Return JSON, text, or file responses
  • Simulate network conditions
  • Monitor all HTTP traffic
  • Upload and serve images and files

Server Tab

Server Status

Shows whether the server is currently running or stopped. When active, displays the server's IP address and port for client access.

Server Status

Note: The server runs on port 8080 by default. Make sure this port is not used by other applications.

Start/Stop Server

Use these buttons to control the server. When started, the app will show the local IP address that clients can use to connect.

Access from mobile: Use the IP address shown in the server status.

Mocks Tab

Creating Mocks

Create custom API endpoints by adding new mocks. Each mock defines an endpoint that responds with your configured data.

Method: HTTP method (GET, POST, PUT, DELETE, etc.)
Path: Endpoint path (e.g., /api/users, /api/data)
Status Code: HTTP status to return (200, 404, 500, etc.)
Delay: Simulate network latency in seconds

Response Types

JSON

Return JSON data with customizable content. Use dynamic variables like {{uuid}}, {{timestamp}}, etc.

Text

Return plain text responses for simple endpoints.

File

Return uploaded files including images. Use the file import button to add files.

Dynamic

Return responses that can change based on request parameters or conditional logic.

Dynamic Variables

When using JSON or Dynamic response types, you can use these variables in your responses:

{{uuid}}: Generates a unique UUID
{{timestamp}}: Current Unix timestamp
{{randomName}}: Random name string
{{randomNumber}}: Random number
{{randomId}}: Random ID value
{{randomEmail}}: Random email address
{{randomBoolean}}: Random boolean value
{{randomDate}}: Random date string

Conditional Logic

For Dynamic responses, you can use conditional logic:

Format: {{#if:condition:then_value:else_value}}
Example: {{#if:query:id=999:404:200}}
Explanation: Returns 404 if id=999, otherwise 200

File Import & Gallery

Import files and images to serve through your endpoints:

  1. Tap the document icon to import files from storage
  2. Tap the photo icon to select images from your gallery
  3. Create a mock with "File" response type
  4. Select your imported file from the available files list
  5. Access the endpoint to serve your file

Supported formats: JPEG, PNG, GIF, WebP, BMP, TIFF, SVG, PDF, and more.

Monitor Tab

Traffic Monitor

Real-time monitoring of all HTTP requests received by the server.

Requests

Shows total number of requests received

Success (2xx)

Shows successful requests (status codes 200-299)

Errors (4xx/5xx)

Shows client and server errors (status codes 400-599)

Request Details

Tap on any request to see detailed information:

  • Request method and path
  • HTTP headers
  • Query parameters
  • Request body
  • Response body
  • Processing time
  • cURL command for reproduction

Chaos Tab

Network Profiles

Simulate different network conditions to test app resilience:

  • WiFi: No delay - fast network
  • 4G: 100ms delay - moderate speed
  • 3G: 500ms delay - slow network
  • Edge: 2s delay - very slow network
  • Custom: Set your own delay in milliseconds

Chaos Monkey

Simulate random server failures to test error handling:

When active, a percentage of requests will fail with the selected error code.

Special Scenarios

Maintenance Mode

All endpoints return 503 Service Unavailable status

New User Scenario

List endpoints return empty arrays (simulates new user experience)

Connect Tab

Connection QR Code

Scan the QR code from your client device to automatically configure the server address:

Note: QR code contains the full server URL (http://IP:port)

Service Discovery

Discover and connect to other SimpleWWWServer instances on the local network:

  • Automatic service advertisement
  • Discover other servers on the network
  • Easy connection using mDNS/bonjour
  • One-click URL copying

Tips & Best Practices

Development Tips

  • Use dynamic variables in JSON responses to avoid duplicate data
  • Test with chaos mode to verify error handling in your app
  • Monitor traffic to understand request/response flow
  • Use file response type to serve images and documents
  • Import images from gallery for real testing scenarios

Troubleshooting

  • Server not starting? Check if port 8080 is available
  • Can't connect from other devices? Make sure they're on the same WiFi
  • Files not showing? Ensure they were imported correctly
  • Image preview not working? Server needs to be running
  • Requests not appearing? Verify your endpoint paths match exactly
  • Endpoints not visible? Try restarting the server