Inspiration

In today's digital age, distractions are just a click away. We've all experienced the frustration of starting a productive work session, only to find ourselves mindlessly scrolling through social media or chatting on Discord minutes later. Traditional website blockers either block everything permanently or require manual toggling, which adds friction to the workflow. We wanted to create a time-bound, selective blocking system that adapts to your focus sessions—something that respects your autonomy while helping you maintain discipline when it matters most.

What it does

Smart Timer with Blocking: Set a customizable countdown timer (hours, minutes, seconds), and during that session, Focus Dock automatically blocks distracting websites and applications you've pre-selected. The blocking is enforced at the system level using Windows PAC (Proxy Auto-Configuration), making it impossible to bypass by simply changing browser settings.

Selective Control: Unlike nuclear-option blockers, Focus Dock gives you granular control. You can: Toggle individual websites/apps on or off Use wildcard patterns (e.g., .reddit.com) to block entire domains Block desktop applications by executable name (e.g., discord, steam.exe)

Enable "Toggle All" for quick bulk operations Integrated Task Management: A built-in task panel lets you track what you're working on during focus sessions. Add tasks with descriptions, check them off as you complete them, and watch them disappear automatically—keeping your workspace clean and motivating.

How we built it

The app is split into two main components:

app.py + UI Components: The PyQt6 GUI that handles: Timer visualization with circular progress arcs using QPainter Dynamic website/app toggle list with real-time search filtering Task management with JSON persistence Subprocess management to launch the blocker engine

mvp_blocker.py: The core blocking engine that runs as a separate process, implementing: PAC Server (port 18080): Serves proxy auto-config to Windows HTTP Proxy (port 3128): Intercepts HTTP/HTTPS traffic via CONNECT tunneling SOCKS5 Proxy (port 1080): Fallback for apps that don't support HTTP proxies App Blocker: Uses psutil to scan running processes every 1-2 seconds, pattern-matching against the blocklist and terminating matches with configurable grace periods

Challenges we ran into

Subprocess Management: PyInstaller's sys.executable pointed to the app itself, causing recursive launches. We solved this by compiling both components as separate executables and invoking mvp_blocker.exe directly.

Zombie Processes: The blocker wouldn't terminate after app closure. We implemented a two-phase shutdown: first clearing PAC settings with --disable-pac-only, then force-killing the process tree using taskkill /F /T.

PAC Propagation Delays: Windows doesn't immediately apply proxy changes. We added multiple InternetSetOptionW API calls and broadcast WM_SETTINGCHANGE messages, though browsers still need to be restarted for immediate effect.

Accomplishments that we're proud of

Built a production-ready desktop app from scratch in a hackathon timeframe, complete with packaging, error handling, and user-friendly UI

System-level integration: Successfully modified Windows registry and implemented PAC without requiring admin privileges or third-party software

Custom proxy servers: Implemented HTTP and SOCKS5 proxies with async I/O, handling CONNECT tunneling, domain filtering, and graceful error handling

Zero external dependencies for blocking: Everything runs locally—no cloud services, no tracking, no data leaving the user's machine

Polished UI/UX: Modern Windows 11 design language with smooth animations, intuitive controls, and attention to detail (shadows, hover effects, focus states)

What we learned

Windows system programming: Learned about PAC, registry manipulation, Windows API calls, and process management with taskkill

Asyncio for I/O-bound tasks: Managing multiple proxy servers and process scanning loops concurrently using Python's async/await patterns

Proxy protocols in depth: Understanding HTTP CONNECT method, SOCKS5 handshake, and how browsers negotiate proxy connections

Subprocess lifecycle management: The hard way—through debugging zombie processes and recursive launches

What's next for Focus Dock

Cross-platform support: Port to macOS/Linux using platform-specific proxy configurations (macOS uses networksetup, Linux uses gsettings or /etc/environment)

Browser extensions: Create companion extensions for Chrome/Firefox that work alongside the desktop app for even stricter blocking (no PAC delays)

Statistics & Analytics: Track focus session duration, blocked access attempts, most distracting sites, and productivity trends over time with charts and insights

Pomodoro mode: Auto-cycle between focus sessions and break periods, automatically unblocking distractions during breaks

Cloud sync: Optional account system to sync blocklists and tasks across multiple devices

Whitelist scheduling: Allow certain sites only during specific time windows (e.g., check email only 9-10 AM and 3-4 PM)

Built With

  • asyncio
  • http/1.1
  • json
  • pac-(proxy-auto-configuration)
  • psutil
  • pyinstaller
  • pyqt6
  • python-3.8+
  • socks5
  • tcp-sockets
  • windows-internet-api-(wininet.dll)
  • windows-registry-api-(winreg)
  • windows-user32-api
Share this project:

Updates