Moonlight Protocols

Overview

High level overview of the protocols flow
Figure 1. High level overview of the protocols flow

Design a better flowchart

There are 6 main protocols involved in the current Moonlight protocol:

  • HTTP (TCP 47989)

    • unencrypted 🔓

    • used to exchanged public information needed to start pairing clients

  • HTTPS (TCP 47984)

    • encrypted 🔐 (SSL)

    • only available to paired clients

    • used to exchange available apps, encryption keys and trigger the start of a stream

  • RTSP (TCP 48010)

    • unencrypted 🔓

    • Used to exchange ports and settings for the next 3 streams

  • Control over ENet (UDP 47999)

    • encrypted 🔐 (using AES GCM 128 bit)

    • Used to exchange user input data and extra stream information

  • Video over RTP (UDP 47998)

    • unencrypted 🔓

    • Uses H.264 or HEVC to encode video

  • Audio over RTP (UDP 48000)

    • encrypted 🔐 (using AES CBC 128 bit)

    • Uses Opus to encode audio

The ports specified here are the defaults, apart from HTTP/S all other ports can be dynamically set by the backend and will be correctly picked up by the Moonlight client.