[PR #623] [MERGED] Stream forwarder #1160

Closed
opened 2026-03-15 11:21:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/623
Author: @ku1ik
Created: 3/28/2024
Status: Merged
Merged: 4/14/2024
Merged by: @ku1ik

Base: developHead: forwarder


📝 Commits (10+)

  • 0c7905d Initial version of stream forwarder
  • 0b282a5 Send close frame in forwarder at the end of the stream
  • 0d7951b Fix stream session shutdown when forwarder is in a reconnection loop
  • 48f64bb Wait for server and forwarder shutdown for 5 sec tops
  • 61a13c5 Prevent race condition when subscribing in session::stream()
  • b4d0cbd Update diag message for stream client count
  • 83d08a0 Easier stream forwarding to asciinema server - asciinema stream -f
  • dd77179 Bail when trying to nest stream sessions using the same relay URL
  • a934381 Rename -f and -l options of stream command to -r and -s respectively
  • 49749b0 Add handling of 401 and 404 responses when obtaining stream info

📊 Changes

10 files changed (+498 additions, -43 deletions)

View changed files

📝 Cargo.lock (+83 -10)
📝 Cargo.toml (+3 -0)
📝 src/cmd/mod.rs (+5 -1)
📝 src/cmd/rec.rs (+1 -1)
📝 src/cmd/stream.rs (+183 -11)
src/streamer/forwarder.rs (+162 -0)
📝 src/streamer/mod.rs (+39 -14)
📝 src/streamer/server.rs (+4 -4)
📝 src/streamer/session.rs (+5 -2)
📝 src/util.rs (+13 -0)

📄 Description

This implements stream forwarding (to asciinema server) for asciinema stream command.

  • asciinema stream -r - relay the stream to user's default server stream
  • asciinema stream -r <ID> - relay the stream to user's specific server stream
  • asciinema stream -r -s - both relay and serve the stream locally

TODO:

  • - is -l / --listen best name? rename to -s / --serve?
  • - is -f / --forward best name? rename to -r / --relay?
  • - is --tty-size best name? rename to -w / --winsize?

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/623 **Author:** [@ku1ik](https://github.com/ku1ik) **Created:** 3/28/2024 **Status:** ✅ Merged **Merged:** 4/14/2024 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `forwarder` --- ### 📝 Commits (10+) - [`0c7905d`](https://github.com/asciinema/asciinema/commit/0c7905db0cf6795a9b11a5b2b4a03388d675663f) Initial version of stream forwarder - [`0b282a5`](https://github.com/asciinema/asciinema/commit/0b282a573701858662e20019d83942cb88d21338) Send close frame in forwarder at the end of the stream - [`0d7951b`](https://github.com/asciinema/asciinema/commit/0d7951b54ce68c54d36748c80d42de7472f4a99a) Fix stream session shutdown when forwarder is in a reconnection loop - [`48f64bb`](https://github.com/asciinema/asciinema/commit/48f64bb22e0d5e2659555e014f79b5f824d7362b) Wait for server and forwarder shutdown for 5 sec tops - [`61a13c5`](https://github.com/asciinema/asciinema/commit/61a13c54cb7071183e92249883f140c7622436cf) Prevent race condition when subscribing in session::stream() - [`b4d0cbd`](https://github.com/asciinema/asciinema/commit/b4d0cbd878bbf175e8311ca2265fc20d1e52e024) Update diag message for stream client count - [`83d08a0`](https://github.com/asciinema/asciinema/commit/83d08a071a17509a0da3f34769efe647e2880727) Easier stream forwarding to asciinema server - `asciinema stream -f` - [`dd77179`](https://github.com/asciinema/asciinema/commit/dd77179d74df9cf89eb02f57c19c8e63cf59c8d9) Bail when trying to nest stream sessions using the same relay URL - [`a934381`](https://github.com/asciinema/asciinema/commit/a934381fb6ae5b22d0bed96ef5ec344a989014a1) Rename -f and -l options of stream command to -r and -s respectively - [`49749b0`](https://github.com/asciinema/asciinema/commit/49749b0bafe64cb1b31fbd9ff1a75222747fd062) Add handling of 401 and 404 responses when obtaining stream info ### 📊 Changes **10 files changed** (+498 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+83 -10) 📝 `Cargo.toml` (+3 -0) 📝 `src/cmd/mod.rs` (+5 -1) 📝 `src/cmd/rec.rs` (+1 -1) 📝 `src/cmd/stream.rs` (+183 -11) ➕ `src/streamer/forwarder.rs` (+162 -0) 📝 `src/streamer/mod.rs` (+39 -14) 📝 `src/streamer/server.rs` (+4 -4) 📝 `src/streamer/session.rs` (+5 -2) 📝 `src/util.rs` (+13 -0) </details> ### 📄 Description This implements stream forwarding (to asciinema server) for `asciinema stream` command. - `asciinema stream -r` - relay the stream to user's default server stream - `asciinema stream -r <ID>` - relay the stream to user's specific server stream - `asciinema stream -r -s` - both relay and serve the stream locally --- TODO: - [x] - is `-l` / `--listen` best name? rename to `-s` / `--serve`? - [x] - is `-f` / `--forward` best name? rename to `-r` / `--relay`? - [ ] - is `--tty-size` best name? rename to `-w` / `--winsize`? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:21:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#1160
No description provided.