diff --git a/CMakeLists.txt b/CMakeLists.txt
index ffa12301..72b08245 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,7 @@ if(WIN32)
set(SUNSHINE_PREPARED_BINARIES "${CMAKE_CURRENT_BINARY_DIR}/pre-compiled/windows")
endif()
+ add_compile_definitions(SUNSHINE_PLATFORM="windows")
add_subdirectory(tools) #This is temporary, only tools for Windows are needed, for now
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_windows.json")
@@ -91,6 +92,7 @@ if(WIN32)
set_source_files_properties(ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_DEFINITIONS "UNICODE=1;ERROR_INVALID_DEVICE_OBJECT_PARAMETER=650")
set_source_files_properties(ViGEmClient/src/ViGEmClient.cpp PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-misleading-indentation -Wno-class-memaccess")
else()
+ add_compile_definitions(SUNSHINE_PLATFORM="linux")
list(APPEND SUNSHINE_DEFINITIONS APPS_JSON="apps_linux.json")
find_package(X11 REQUIRED)
@@ -144,6 +146,10 @@ set(SUNSHINE_TARGET_FILES
sunshine/crypto.h
sunshine/nvhttp.cpp
sunshine/nvhttp.h
+ sunshine/httpcommon.cpp
+ sunshine/httpcommon.h
+ sunshine/confighttp.cpp
+ sunshine/confighttp.h
sunshine/rtsp.cpp
sunshine/rtsp.h
sunshine/stream.cpp
diff --git a/assets/web/apps.html b/assets/web/apps.html
new file mode 100644
index 00000000..d1784608
--- /dev/null
+++ b/assets/web/apps.html
@@ -0,0 +1,160 @@
+
+
+
Applications
+
Applications are refreshed only when Client is restarted
+
+
+
+
+
+
Name
+
Actions
+
+
+
+
+
{{app.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
Application Name, as shown on Moonlight
+
+
+
+
+
+
The file where the output of the command is stored, if it is not
+ specified, the output is ignored
+
+
+
+
+
A list of commands to be run before/after the application. If any of the
+ prep-commands fail, starting the application is aborted
+
+
+
Do
+
Undo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{c}}
+
+
+
+
+
+
+
A list of commands to be run and forgotten about
+
+
+
+
+
+
The main application, if it is not specified, a processs is started that
+ sleeps indefinitely
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/web/clients.html b/assets/web/clients.html
new file mode 100644
index 00000000..c2d03025
--- /dev/null
+++ b/assets/web/clients.html
@@ -0,0 +1,3 @@
+
+
Clients
+
\ No newline at end of file
diff --git a/assets/web/config.html b/assets/web/config.html
new file mode 100644
index 00000000..356e4d45
--- /dev/null
+++ b/assets/web/config.html
@@ -0,0 +1,492 @@
+
The name displayed by Moonlight. If not specified, the PC's hostname is used
+
+
+
+
+
+
+
The minimum log level printed to standard out
+
+
+
+
+
+
The origin of the remote endpoint address that is not denied for HTTP method /pin
+
+
+
+
+
+
+
If no external IP address is given, the local IP address is used
+
+
+
+
+
+
How long to wait in milliseconds for data from moonlight before shutting down the
+ stream
+
+
+
+
+
+
+
+
+ {{r}}
+ ×
+
+
+
+
+
+
+
+
+ {{f}}
+ ×
+
+
+
+
+
+ The display modes advertised by Sunshine
+ Some versions of Moonlight, such as Moonlight-nx (Switch),
+ rely on this list to ensure that the requested resolutions and fps
+ are supported.
+
+
+
+
+
+
+
+
+
+
The private key must be 2048 bits
+
+
+
+
+
+
The certificate must be signed with a 2048 bit key
+
+
+
+
+
+
+
The file where current state of Sunshine is stored
+
+
+
+
+
+
The file where current apps of Sunshine are stored
+
+
+
+
+
+
+
+
+ The back/select button on the controller.
+ On the Shield, the home and powerbutton are not passed to Moonlight.
+ If, after the timeout, the back button is still pressed down, Home/Guide button press is
+ emulated.
+ If back_button_timeout < 0, then the Home/Guide button will not be emulated
+
+
+
+
+
+
+
+ Control how fast keys will repeat themselves
+ The initial delay in milliseconds before repeating keys
+
+
+
+
+
+
+
+ How often keys repeat every second
+ This configurable option supports decimals
+
+
+
+
+
+
+
+
+
+
+ The name of the audio sink used for Audio Loopback
+ You can find the name of the audio sink using the following command:
+
tools\audio-info.exe
+
+
+ The name of the audio sink used for Audio Loopback
+ If you do not specify this variable, pulseaudio will select the default monitor device.
+
+ You can find the name of the audio sink using the following command:
+
pacmd list-sinks | grep "name:"
+
+
+
+
+
+
+
+ The virtual sink, is the audio device that's virtual (Like Steam Streaming Speakers), it allows Sunshine
+ to stream audio, while muting the speakers.
+
+
+
+
+
+
+
+ You can select the video card you want to stream:
+ The appropriate values can be found using the following command:
+
tools\dxgi-info.exe
+
+
+
+
+
+
+
+ You can select the video card you want to stream:
+ The appropriate values can be found using the following command:
+ tools\dxgi-info.exe
+ !! Linux only !!
+ Set the display number to stream. I have no idea how they are numbered. They start from 0, usually.
+
+
+
+
+
+
+
+
+
+ Constant Rate Factor. Between 1 and 52. It allows QP to go up during motion and down with still
+ image,
+ resulting in constant perceived quality
+ Higher value means more compression, but less quality
+ If crf == 0, then use QP directly instead
+
+
+
+
+
+
+
+ Quantitization Parameter
+ Higher value means more compression, but less quality
+ If crf != 0, then this parameter is ignored
+
+
+
+
+
+
+
+ Minimum number of threads used by ffmpeg to encode the video.
+ Increasing the value slightly reduces encoding efficiency, but the tradeoff is usually
+ worth it to gain the use of more CPU cores for encoding. The ideal value is the lowest
+ value that can reliably encode at your desired streaming settings on your hardware.
+
+
+
+
+
+
+
+ Allows the client to request HEVC Main or HEVC Main10 video streams.
+ HEVC is more CPU-intensive to encode, so enabling this may reduce performance when using software
+ encoding.
+
+
+
+
+
+
+
+ Force a specific encoder, otherwise Sunshine will use the first encoder that is available
+
+
+
+
+
+
+
+ How much error correcting packets must be send for every video.
+ This is just some random number, don't know the optimal value.
+ The higher fec_percentage, the lower space for the actual data to send per frame there is
+
+
+
+
+
+
+
+ When multicasting, it could be useful to have different configurations for each connected Client.
+ For example:
+
+
Clients connected through WAN and LAN have different bitrate contstraints.
+
Decoders may require different settings for color
+
+ Unlike simply broadcasting to multiple Client, this will generate distinct video streams.
+ Note, CPU usage increases for each distinct video stream generated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Success! Restart Sunshine to apply changes
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/web/header.html b/assets/web/header.html
new file mode 100644
index 00000000..1c9702e6
--- /dev/null
+++ b/assets/web/header.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+ Sunshine
+
+
+
+
+
+
+