> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# SFU (one-to-many streaming)

> Stream a single Unreal Engine instance to many viewers using a Selective Forwarding Unit, with one host and multiple watch-only players.

SFU (Selective Forwarding Unit) lets one Unreal Engine instance stream to many viewers — one **Host** controls the app, everyone else watches. SFU is a **platform feature**, not an SDK-only capability — you can also create SFU sessions from the [Sharing tab in the dashboard](/resources/quick-start-guide/meeting-rooms) (where they're called Meeting Rooms) or from a plain share URL with `?streamerId=...&sfuHost=true` query params.

This page covers the **SDK** path — programmatic control over SFU sessions for custom frontends.

## Video tutorial

<iframe width="100%" height="420" src="https://www.youtube.com/embed/mYtOnX7FX2U" title="Introducing Meeting Rooms" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; fullscreen" allowfullscreen />

## Architecture

In standard mode, each viewer gets a dedicated UE instance (1:1). With SFU:

* One UE instance renders the content
* The SFU server receives the stream and forwards it to multiple viewers
* One user is the **Host** (can send input to UE), all others are **Players/Viewers** (watch-only)

<Info>
  There is exactly one host per SFU session. The host is the only user who can send mouse, keyboard, and other input to the Unreal Engine application.
</Info>

## Roles

### Host

The host controls the UE application. There is one host per SFU session. The host can send mouse, keyboard, and other input to UE.

```javascript theme={"dark"}
await StreamPixelApplication({
  appId: 'your-project-id',
  sfuHost: 'true',
  AutoConnect: true,
});
```

### Player (viewer)

Players watch the stream but cannot send input to UE. Multiple players can connect simultaneously.

<Warning>
  Players and viewers are watch-only. They cannot send any input (mouse, keyboard, touch, gamepad) to the Unreal Engine application.
</Warning>

```javascript theme={"dark"}
await StreamPixelApplication({
  appId: 'your-project-id',
  sfuPlayer: 'true',
  AutoConnect: true,
});
```

### Default (neither)

When neither `sfuHost` nor `sfuPlayer` is set, the SDK uses standard 1:1 streaming.

## Configuration via URL parameters

SFU mode can also be set via URL query parameters, which is useful for sharing links:

```text theme={"dark"}
https://yourapp.com/PROJECT_ID?sfuHost=true
https://yourapp.com/PROJECT_ID?sfuPlayer=true
```

You can also target a specific streamer instance:

```text theme={"dark"}
https://yourapp.com/PROJECT_ID?sfuPlayer=true&streamerId=hostInstance123
```

## Use cases

* **Live presentations**: One person presents in UE, many watch
* **Spectator mode**: Players watch a game being played by the host
* **Virtual events**: Stream a virtual environment to a large audience
* **Training/demos**: Instructor controls the application, trainees observe
* **Cost optimization**: Serve many viewers from a single UE instance

## Next steps

<CardGroup cols={2}>
  <Card title="Communicating with Unreal Engine" icon="arrows-left-right" href="/resources/web-sdk/features/communicating-with-ue">
    Send and receive data between the web client and UE.
  </Card>

  <Card title="Voice and text chat" icon="microphone" href="/resources/web-sdk/features/voice-text-chat">
    Add real-time voice and text chat for SFU sessions.
  </Card>
</CardGroup>
