Feature: HTTP and WebSocket data source support #24
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.
Summary
Adds support for WebSocket and streaming HTTP servers as a data source. Uses the same data format as the serial connection.
Motivation & Context
Implements the suggestion in #10 as close as possible (requires HTTP headers to be added to the beginning of the TCP stream)
Changes
How to Test
To test HTTP functionality:
To test WebSocket functionality:
Checklist
npm run lintand fixed any issuesnpm run typecheck(TypeScript) with no errorsnpm testand tests passnpm run test:coverageif code paths changed significantlyAdditional Notes
You cannot request resources served over an insecure protocol from a page served over HTTPS, and it is often impractical to set up TLS. @cgreening Perhaps a bundled single-file version of this web app could be provided to make it simpler for people to run locally?
I have duplicated a bit of text parsing code from useSerial.ts, it would probably be better to move that somewhere else and then call it from both useSerial.ts and useHttp.ts
I used Claude 3.5 Sonnet and GPT-5 to help write a portion of the code in this pull request.