Multi-Protocol Server
The MultiProtoServer sample demonstrates a unified streaming server built on StreamingServer that combines all VASTreaming server components into a single application. It serves as a comprehensive reference for building multi-protocol streaming servers in .NET.
Supported Protocols
The server can simultaneously run any combination of the following protocols:
| Protocol | Default Port | Path |
|---|---|---|
| RTMP | 1935 | /live/<name> |
| RTMPS | 1936 | /live/<name> (disabled by default) |
| RTSP | 554 | /<name> |
| RTSPS | 322 | /<name> (disabled by default) |
| SRT | 21330 | streamid=<name> |
| HLS | 8888 | /hls/<name> |
| MPEG-DASH | 8888 | /dash/<name> |
| WebRTC | 8888 | /rtc |
| MJPEG over HTTP | 8888 | /mjpeg/<name> (disabled by default) |
| TS over HTTP | 8888 | /ts/<name> (disabled by default) |
| PCM over WebSocket | 8888 | /pcm (disabled by default) |
WebRTC, MPEG-DASH, HLS, and HTTP-based transports share a common HTTP server. Each protocol can be independently enabled or disabled via Enable* properties.
Architecture
The sample is organized into the following areas:
Initialization — server creation, protocol configuration, endpoint assignment, and secure transport setup (RTMPS, RTSPS, HTTPS). Includes optional TURN server for WebRTC.
Event Handlers — handling client authorization, on-demand publishing point creation, publisher and client connections, forwarding, recording, errors, disconnections, and SRT file transfers.
Publishing Points — the core of the sample. The server demonstrates 14 different ways to create and feed publishing points, grouped below.
JSON API — built-in REST API for monitoring and controlling the server at runtime.
Publishing Point Use-Cases
Publishing points define what content the server streams and how that content is sourced. The sample covers three categories:
Common Sources
These use-cases are covered in Common Publishing Point Use-Cases:
| # | Use-Case | Description |
|---|---|---|
| 1 | Pull source | Pull stream from a remote server and redistribute |
| 2 | VOD file | Serve a single MP4 file as video-on-demand via HLS or MPEG-DASH |
| 3 | VOD stream | Serve VOD from a user-provided in-memory stream |
| 4 | VOD directory | Serve all files in a directory with wildcard and recursive access |
| 5 | Loop file | Play a file in endless loop as a live stream |
| 6 | Image source | Generate encoded video from a static image |
Capture Sources
| # | Use-Case | Description | Details |
|---|---|---|---|
| 7 | Camera/microphone | Capture from hardware devices | Capture Source |
| 14 | Screen/window | Capture screen or a specific application window | Screen Capture |
User Push Sources
These use-cases demonstrate pushing user-generated media data into the server:
| # | Use-Case | Description | Details |
|---|---|---|---|
| 8 | Pre-encoded push | Push H.264/AAC packets via VirtualNetworkSource | Push Source 1 |
| 9 | ImageSource push | Use ImageSource to encode user-provided images | Push Source 2 |
| 10 | Raw video encoding | Encode uncompressed video frames on the fly | Push Source 3 |
| 11 | RTP packet push | Push raw RTP packets via VirtualRtpSource | Push Source 4 |
Advanced Sources
| # | Use-Case | Description | Details |
|---|---|---|---|
| 12 | Mixing source | Create a mixing publishing point that composites multiple inputs | Mixing Source |
| 13 | Proxy source | Re-stream a pull source with forced transcoding | Proxy Source |
Conditional Compilation
The sample uses conditional compilation symbols (VAST_FEATURE_RTMP, VAST_FEATURE_RTSP, VAST_FEATURE_SRT, etc.) to include only the protocols available in your license. The project files already define these symbols for the included libraries. If a protocol library is not referenced, its code is excluded at compile time.
See Also
- Sample Applications — overview of all demo projects
- .NET Server Demo — parent page with setup instructions, license key configuration, and access URL reference
- VAST.Network Library — StreamingServer API reference