NAME

Langertha::Skeid::Proxy::RelayContent - Upstream response content that is always relayed as raw bytes

VERSION

version 0.003

DESCRIPTION

The content object the proxy puts on a streaming upstream response before starting it: a Mojo::Content::Single that never takes Mojolicious's own Server-Sent Events path.

Mojolicious parses a response body itself when its Content-Type is exactly text/event-stream (no parameters) and the body is not chunked: the bytes become sse events and no read event is ever emitted. The relay reads the upstream on read, so such an upstream would be relayed as nothing and metered as a served request without tokens. Skeid reads the SSE frames itself and relays them byte for byte, so it needs the bytes whatever the exact media type or framing.

my $tx = $ua->build_tx(POST => $url, \%headers, json => $body);
$tx->res->content(Langertha::Skeid::Proxy::RelayContent->new);
$tx->res->content->unsubscribe('read')->on(read => sub { ... });

is_sse

Always false, so the body is parsed as plain content and every byte arrives on read.

SEE ALSO

Langertha::Skeid::Proxy, Mojo::Content::Single

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha-skeid/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.