How tsukinatsune/pysimple-sharescreen works
Project Type and Purpose
• This is a lightweight, single-host screen-sharing tool written in C (build.c → Release.exe) that captures the desktop, encodes frames as Motion-JPEG, and serves them via HTTP on port 8080.
• A companion HTML client (Sharescreen.html) connects to that stream.
File Structure
• Top level:
• build.c : source code for the capture + HTTP server
• Release.exe : compiled binary
• Sharescreen.html : client-side viewer
• file/ : resource directory containing .trafileN (likely configuration or resource data)
• No separate frontend/backend folders—both client (HTML) and server (C) coexist in the same repo.
• No external DB or microservices—everything runs on one host.
Extract Key Architectural Insights from README
• The server listens on port 8080 and streams MJPEG.
• The user must port-forward that port externally.
• The HTML page fetches the MJPEG stream over HTTP.
Relationships & Data Flows
1. Desktop frames → pass to JPEG Encoder
2. Encoder outputs motion-JPEG frames → HTTP Server
3. HTTP Server exposes an MJPEG stream on localhost:8080
4. External user/browser fetches via port-forward → displays in Sharescreen.html
5. Resource Loader feeds any static data (e.g., config, overlays) into the server at startup.
Architectural Patterns & Design Principles
• Monolithic, single-process model
• Modular internal separation: capture → encode → serve
• HTTP-based streaming (stateless per frame)
• File-based configuration/resources
Technologies & Frameworks
• C standard library + platform-specific screen capture APIs
• HTTP protocol (simple socket server)
• MJPEG format
• HTML5 <img> tag or <video> tag for client