Add /stream endpoint for real-time display via MJPEG streaming#555
Draft
Add /stream endpoint for real-time display via MJPEG streaming#555
Conversation
Co-authored-by: skylersaleh <7118296+skylersaleh@users.noreply.github.com>
Co-authored-by: skylersaleh <7118296+skylersaleh@users.noreply.github.com>
Co-authored-by: skylersaleh <7118296+skylersaleh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add realtime display stream via websockets
Add /stream endpoint for real-time display via MJPEG streaming
Feb 11, 2026
|
Web build for eafb108 will be live at https://web.skyemu.app/commit/eafb108cc1a9e0a73b7054aa1ffeff8e7a1ffd73/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTTP Control Server currently requires polling /screen at ~30 FPS for real-time display, creating excessive TCP handshake overhead (30+ connections/sec).
Implementation
Added /stream endpoint using
multipart/x-mixed-replace(MJPEG):src/http_control_server.h: Addedhcs_stream_callbacktype andhcs_set_stream_callback()src/http_control_server.cpp: Implemented streaming endpoint with chunked content providersrc/main.c: Addedse_hcs_stream_callback()for frame generation with JPEG encodingdocs/HTTP_CONTROL_SERVER.md: Documented new endpointKey features:
Usage
Works directly in HTML without JavaScript:
Technical Notes
Chose multipart/x-mixed-replace over WebSockets:
<img>tagsSingle persistent connection eliminates per-frame TCP overhead while maintaining precise frame timing via
std::this_thread::sleep_for().Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.