Skip to content

Feature request: optional HTTP CORS headers for the streaming server (for browser / Web Audio embedding) #59

@dudematthew

Description

@dudematthew

Problem

SWYH exposes the stream over HTTP (e.g. http://:/stream/swyh.mp3). That works in a dedicated browser tab, VLC, etc.

It fails when the stream is played inside another web app (e.g. a VTT or any page on a different origin: different scheme, host, or port). The browser then loads the stream as a cross-origin subresource for Web Audio / pipelines that require CORS. Despite response 200, the error goes like this:

blocked by CORS policy: No Access-Control-Allow-Origin header on the requested resource

So the limitation is not “localhost vs LAN IP” alone: any page served from e.g. http://localhost:30000 cannot use audio from http://this-machine:5901 unless the stream response includes appropriate CORS headers.

Request

Please add configurable CORS for the built-in streaming HTTP server, for example:

Toggle: “Send CORS headers for stream URLs”

Or Allow-Origin value(s), e.g.:
a single origin: http://localhost:30000
or * (with a clear warning that it is broad)

Minimal useful set for many embed cases:

Access-Control-Allow-Origin:
If credentials are not used, * may be enough for simple GET streaming; if you support cookies later, document the implications.

Why this helps

Many GMs use SWYH to pipe desktop audio into tools that run in the browser. Those tools cannot disable CORS from JavaScript; the server must opt in. Today the workaround is an external reverse proxy just to add headers - native support in SWYH would remove that friction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions