feat(videowidget): send Authorization header on raw-socket MJPEG stream - #142
Open
thusser wants to merge 1 commit into
Open
feat(videowidget): send Authorization header on raw-socket MJPEG stream#142thusser wants to merge 1 commit into
thusser wants to merge 1 commit into
Conversation
Once BaseVideo (pyobs-core PR #799) enforces a shared token, the live view dies with a 401 that the MJPEG parser never surfaces. The widget already opens the video URL as an HttpFile; keep its Authorization header and append it to the raw-socket GET in _showEvent. Without a token the written bytes are unchanged. Companion to pyobs-core feat/basevideo-http-token-auth — land together. Implements specs/plans/2026-08-21-basevideo-http-token-auth.md (pyobs-gui half).
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.
pyobs-gui half of
specs/plans/2026-08-21-basevideo-http-token-auth.md(indexed in this repo atspecs/).What
VideoWidgetopens the MJPEG video URL as anHttpFilein_init, but streams it over a rawQTcpSocket/QSslSocketwith a hand-written GET that currently sends no auth. Once the server side (BaseVideo, pyobs-core PR #799) enforces a shared token, that request gets a401which the MJPEG parser never surfaces (it strips response headers and finds no--jpgboundary)._init: after theHttpFiletype check, storeself._auth_header = video_file.headers.get("Authorization")(None when the VFS root configures no token)._showEvent: appendAuthorization: <value>\r\nto the raw-socket GET when set; bytes written are unchanged when unset.Depends on the new public
HttpFile.headersproperty (pyobs-core PR #799).Tests
tests/test_videowidget.py: with a token the written GET includesAuthorization: Bearer <token>; without a token the written bytes are byte-identical to today.VideoWidgetconsumer change.pyobs/pyobs-core#799: server-sideBaseVideotoken/cookie auth +HttpFile.headers.With
tokenset on a webcam, the GUI live view breaks until this lands — merge both PRs together.