Skip to content

Telaeris/Simple204Server

Repository files navigation

Simple204Server

A lightweight HTTP server that returns HTTP 204 (No Content) for Android connectivity checks. Designed for offline device provisioning scenarios.

Complete Setup Instructions for Offline Android Provisioning

Note: These instructions are for Windows 10/11 PCs. Download and set up all required files before going offline or to your provisioning location.

Prerequisites (Download Ahead of Time)

  1. Dual DHCP DNS Server

  2. Simple204Server.exe

    • Download the latest release from this repository's Releases page
    • Save to a convenient location (e.g., C:\Provisioning\)
  3. Sample DualServer.ini configuration

    • Included in this repository
    • Copy to your DualServer installation folder (typically C:\DualServer\)

Step-by-Step Setup

1. Create Mobile Hotspot on Your Laptop

  1. Open SettingsNetwork & InternetMobile hotspot
  2. Toggle "Share my Internet connection with other devices" to On
  3. Note your network name and password
  4. Your laptop will typically get IP address: 192.168.137.1

2. Configure Dual DHCP DNS Server

  1. Navigate to your DualServer installation folder (typically C:\DualServer\)
  2. Copy the DualServer.ini file from this repository into the DualServer folder (overwrite existing if prompted)
  3. Verify the configuration includes these sections:
   [DNS_HOSTS]
   connectivitycheck.gstatic.com=192.168.137.1
   clients3.google.com=192.168.137.1
   www.google.com=192.168.137.1
   
   [RANGE_SET]
   DHCPRange=192.168.137.10-192.168.137.200

3. Start Dual DHCP DNS Server

Option A: Using the Windows Service (Recommended)

  1. Open Services (Windows Key + R, type services.msc)
  2. Find "Dual DHCP DNS Server" in the list
  3. Right-click and select "Start"
  4. Optionally set to "Automatic" startup if you use this frequently

Option B: Run the executable directly

  1. Navigate to C:\DualServer\
  2. Right-click on DualServer.exe
  3. Select "Run as administrator"
  4. Keep this window open while provisioning

4. Start Simple204Server

  1. Open Command Prompt as Administrator

    • Press Windows Key
    • Type cmd
    • Right-click on "Command Prompt" and select "Run as administrator"
  2. Navigate to where you saved Simple204Server.exe:

   cd C:\Provisioning
  1. Run the server with your hotspot IP:
   Simple204Server.exe 192.168.137.1 80
  1. You should see:
   Server running on http://192.168.137.1:80/
   Returning HTTP 204 for /generate_204
   Returning HTTP 200 for all other requests
   Press Ctrl+C to stop
  1. Keep this window open

5. Connect Android Devices

  1. On your Android device, connect to your laptop's hotspot (the network name from Step 1)
  2. The device will automatically:
    • Receive an IP address via DHCP (192.168.137.10-200 range)
    • Get DNS settings pointing to your laptop
    • Successfully pass connectivity checks
    • Function normally in "offline" mode

Troubleshooting

"Access Denied" or "Permission Required" errors:

  • Make sure you're running both DualServer.exe and Simple204Server.exe as Administrator

Android shows "No Internet" or won't connect:

  • Verify both servers are running (check the console windows)
  • Verify your laptop's hotspot IP is 192.168.137.1 (run ipconfig to check)
  • Check Windows Firewall isn't blocking the connections

Port 80 already in use:

  • Another service (IIS, Apache, etc.) might be using port 80
  • Stop the conflicting service or use a different port (e.g., Simple204Server.exe 192.168.137.1 8080)

Purpose

When setting up Android devices on isolated networks (no internet), Android performs connectivity checks by trying to reach connectivitycheck.gstatic.com/generate_204. This server responds with the expected HTTP 204 status code, allowing Android devices to function properly without real internet connectivity.

Features

  • Returns HTTP 204 for any URL containing /generate_204
  • Returns HTTP 200 for all other requests
  • Lightweight single executable
  • Configurable IP address and port

Requirements

  • Windows 10/11
  • .NET Framework 4.7.2+ (pre-installed on most modern Windows systems)
  • Administrator privileges (for port 80)

Usage

Simple204Server.exe <ip-address> [port]

Examples

# Listen on 192.168.137.1 port 80 (requires Administrator)
Simple204Server.exe 192.168.137.1 80

# Listen on a different port (doesn't require Administrator)
Simple204Server.exe 192.168.137.1 8080

Building from Source

Visual Studio

  1. Open Simple204Server.sln
  2. Build → Build Solution (F6)
  3. Executable is in Simple204Server/bin/Release/Simple204Server.exe

Command Line

nuget restore
msbuild /p:Configuration=Release

License

MIT License - feel free to use and modify as needed.

Related Tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages