Guests from other devices #
Rubylight docs › Play together
Several people can play one game on the PC from their own paired devices. While one device plays (the owner), a second paired device that joins the running game becomes its guest. The guest sees the same picture and hears the same sound, gets a controller of its own as the next player, and gets the keyboard and mouse only if the owner grants them. Nightjar on Android and desktop and stock Moonlight clients can all join; the owner answers on their own device, or anyone with access answers in the console.
Guests are paired devices. To share a stream with someone in a browser without pairing, use browser guests instead.
Joining #
A device joins the running game in either of these ways:
- Nightjar: select the game another device is playing and press Join (shown as Stream here too on hosts without guests).
- Moonlight and other clients: start the app that is already running, or resume it. Both work as before when guests are off or when the device is the owner.
What happens next follows When another device joins the running game (guest_join, under Settings → Games → Play together):
| Value | What happens |
|---|---|
Ask the player (ask) |
The join waits up to 45 seconds while the owner's Nightjar and the console's Home page show the request. Let in starts the guest's stream; Deny, or no answer, refuses it with the reason. |
Let in without asking (allow) |
The device joins at once with What a guest may do. The owner can still change, kick or block it. |
Off (off, default) |
The device streams beside the game with its own device permissions, as before guests existed. One person moving between their own devices joins or resumes without anyone answering. |
A join is refused with a reason the client shows:
- "The player did not let you join"
- "Nobody answered your request to join"
- "This game has as many guests as it takes" (at most 4 guests at once)
- "The game ended before you could join"
- "The player does not let you join this game"
Moonlight clients show the text in their launch error.
Nightjar waits up to 120 seconds for a join answer. Moonlight clients that give up on a launch sooner than 45 seconds show their own timeout instead. In that case, answer sooner or switch to Let in without asking.
Invite a friend over the internet #
A friend who has never been on your network can join with Nightjar on Android, Windows, Linux or macOS. No PIN, no port forwarding and no visit are needed:
- Make an invite. In the console, Invite a friend on Home, under the Guests card; or, in your own Nightjar during a stream, the Guests page of the Control Center, then Invite a friend over the internet. Making one needs Approve new devices or Host control on that device.
- Send the link to one person. It looks like
rubylight://invite#…. Many chat apps don't make such a link clickable, so the friend can also copy it and paste it under Add PC in Nightjar. - The friend opens it and confirms Join. Nightjar finds the PC over the internet (its IPv6 address, a forwarded port, or a path punched through both routers, as Play over the internet does), pairs as a guest without a PIN, and lists the PC. This can take up to a minute.
- The friend joins your game: they select the game you play and press Join, and you let them in as any guest.
What an invite gives, and what it doesn't:
- One device, once. An invite pairs one device and is spent then; a second use is refused. It ends after a day (in the console: 1 hour, 24 hours or 7 days; through the API 5 minutes to 7 days) and can be taken back while unused. At most 8 unused invites exist at a time. They are kept in memory only: a host restart ends every unused one.
- Guest rights only, until the invite's time ends. The friend's device gets the invite's guest permission (View, Controller, or Controller with keyboard and mouse, never more than the device that made it holds). It never gets Launch, Host control, Approve new devices or a first device's rights, and the PC's other settings and apps stay out of its reach. It can only join a game someone plays, and the player is always asked first, whatever When another device joins the running game says. When the invite's time ends, the host unpairs the device. Invited devices in the console's invite card removes one earlier.
- Play over the internet only for this. With
internet_playoff, the host runs its rendezvous only while an unused invite or an invited device needs it, only for those, and stops it after. With it on, an invited device is reached like any other. - The PC is checked. The link names the PC's certificate: Nightjar pairs only with the PC that made it. Pairing with an invite works only while Allow pairing (
enable_pairing) is on.
The link is a secret, like a key to a guest seat: anyone who holds it before your friend uses it can join in their place, as a guest you still let in. Send it only to the friend, and take it back in the console if it went astray. Everything after # stays on the devices that open it: a browser never sends it to a website.
What a guest may do #
What a guest may do (guest_permission, default controller) is the permission a guest gets when the owner lets it in without choosing one. The owner can change it for each guest at any time.
| Permission | The guest gets |
|---|---|
View only (view) |
The picture and sound. Its controller, keyboard and mouse are ignored, and no controller of its own is plugged in on the PC: a guest made view only loses the ones it had. |
Controller (controller) |
A virtual controller of its own, as the next player. Its keyboard and mouse are ignored. |
Controller, keyboard and mouse (controller-keyboard-mouse) |
Also the keyboard and mouse, one holder at a time (see below). It also gets the clipboard, USB forwarding and its microphone, where its own device permissions allow them. |
A guest's touch and pen input is always ignored: on the PC they act as a mouse. A guest never gets more than its own device permissions allow.
One keyboard and mouse at a time #
Only one person types and moves the pointer at a time:
- A guest with keyboard and mouse takes them by using them while nobody else has used them for two seconds.
- The owner takes them back by using its own keyboard or mouse.
- Someone at the PC takes them back by moving its mouse or pressing a key.
- The owner and the console can also hand them to a guest or take them back with Give keyboard and Take back keyboard.
When a guest loses the keyboard and mouse, the host releases any key or button it still held down. Controllers are not part of this rule: every controller plays at once.
The PC's own mouse and keyboard are watched only while a guest with keyboard and mouse is streaming.
Kick, block and expiry #
- Kick ends the guest's stream with "The player removed you from the game". The device may ask to join again.
- Block ends it with "The player does not let you join this game" and refuses that device's joins until the game ends.
- How long a guest may stay is chosen when letting it in: until the game ends (default), or 1 hour or 24 hours in the console. The host accepts 5 minutes to 7 days through the API. When the time is up the stream ends with "Your time as a guest in this game ended".
- When the game ends, or another game starts, every guest's stream ends with "The game you joined ended".
A guest that loses its connection keeps its place and can come back.
Where to manage guests #
- The owner's Nightjar:
- when a device asks to join, Android asks during the stream with Let in and Deny; Nightjar for Windows and Linux shows a notice and answers on the Control Center's Guests page;
- the Control Center's Guests page, with each guest's permission, Kick and Block.
- The console:
- on Home, a Guests card lists the joins waiting and the guests, with permission, stay, keyboard hand-over, Kick and Block;
- each guest's stream card shows a Guest badge.
- Another device with Host control can manage guests through the native API, as the owner can.
How the picture reaches each guest #
Each guest gets its own encoder on the owner's capture. The guest's stream shares the virtual display the game is on, as Stream here too always has. It takes that display as it is and never changes the display's mode, HDR or scale. The capture is shared between streams of that display, so the GPU captures once. Each stream encodes it at its own codec, size, frame rate and bitrate.
We chose this over sending every viewer one shared encoded stream because:
- The owner's latency does not change. The owner's encoder, pacing and bitrate adaptation never wait for a guest or take its link into account. A guest on a slow network lowers only its own bitrate.
- Every client keeps its own codec and size. A phone can receive 720p H.264 while the owner plays 4K AV1. One shared stream would make every viewer accept the owner's codec and resolution, which stock Moonlight clients can't negotiate.
- Loss recovery stays per device. A guest's lost packets and reference-frame requests reach only its own encoder. With one shared stream, every viewer's loss would force keyframes on everyone.
The cost is one more encoder session per guest. A 4K guest takes about as much encoder time as a second 4K stream. A guest at a lower resolution takes proportionally less. The host allows at most 4 guests besides the owner, so the encoder sessions stay within what the drivers allow.
Sound reaches each guest like any second stream of the PC.
Privacy #
- A guest sees and hears everything the owner's stream shows, including notifications and other windows on that display. Let in only people you'd let watch your screen.
- The owner's device, the console and devices with Host control see each guest's and requester's device name, what it may do, and when it joined. Guests and other paired devices see the same list but can't change it.
- An invited friend's device name and when its time ends are listed under Invited devices in the console. The host keeps the invite links in memory only, and the invited device with its paired devices until its time ends.
- The host keeps the guest list in memory only. Nothing about guests is written to disk, except log lines that name the device and what happened (joined, let in, denied, kicked, blocked, ended).
- Watching the PC's local mouse and keyboard uses raw input only to see that someone at the PC used them. Nothing about what was typed or where the mouse moved is kept or sent.
See also Privacy.
For developers #
- Invites: the native API lists
session.guest-inviteswhile Allow pairing (enable_pairing) is on. An invite carries, after#, a 32-byte secretk, the PC's ID, certificate SHA-256, name, end, permission and ports, and the PC's last public endpoints, NAT type, IPv6 and forwarded IPv4 hints. Both sides derive fromk(HKDF-SHA256, saltrubylight internet play v1) the rendezvous secret for Play over the internet and a one-time pairing PIN of 32 hex digits, which the host accepts only for that invite; the client refuses a PC whose certificate is not the link's. The paired device carriesinvited_guest(until,permission) in itsextra. Clients read the guests list and ask about joins while either feature is listed, since an invited device always waits for the player, also withguest_joinoff. Code:rust/core/src/invites.rs,rust/host/src/invites.rs,client/protocol/core/src/invite_uri.rs,client/protocol/traverse/src/invite.rs,client/protocol/client/src/invite.rs. - Host capability: the native API lists the feature
session.guestswhileguest_joinis notoff. Clients show Join, the approval prompt and the guest list only when it is listed. The host keepsPROTOCOL_VERSION, and Moonlight clients use no new messages: a guest's stream is an ordinary stream. - Endpoints: the routes and types are in Native API: Session, under Guests from other devices. The console's equivalents are under
/api/session-guests. - Code:
- The join policy, the guest list and the keyboard-and-mouse holder are pure state machines in
rust/core/src/multiclient.rs, tested inrust/core/src/multiclient/tests.rs. - The host side is in
rust/host/src/multiclient.rs, with its join gate innvhttp.rsand input gating instream/control.rs. - The PC's local input watcher is in
rust/windows/io/src/local_input.rs. - The launch option
rlGuestmarks a guest's launch. The host sets it and removes it from every client request.
- The join policy, the guest list and the keyboard-and-mouse holder are pure state machines in