|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for common HTTP. More...
#include <filesystem>#include <utility>#include <boost/asio/ssl/context.hpp>#include <boost/asio/ssl/context_base.hpp>#include <boost/property_tree/json_parser.hpp>#include <boost/property_tree/ptree.hpp>#include <boost/property_tree/xml_parser.hpp>#include <curl/curl.h>#include <Simple-Web-Server/server_http.hpp>#include <Simple-Web-Server/server_https.hpp>#include "config.h"#include "crypto.h"#include "file_handler.h"#include "httpcommon.h"#include "logging.h"#include "network.h"#include "nvhttp.h"#include "platform/common.h"#include "process.h"#include "rtsp.h"#include "utility.h"#include "uuid.h"Functions | |
| int | http::create_creds (const std::string &pkey, const std::string &cert) |
| Generate HTTPS credential files from the provided key and certificate paths. | |
| bool | http::download_file (const std::string &url, const std::string &file, long ssl_version) |
| Send a static file response for a Web UI request. | |
| int | http::init () |
| Load persisted HTTP credentials and initialize shared request state. | |
| int | http::reload_user_creds (const std::string &file) |
| Reload the Web UI credentials from disk. | |
| int | http::save_user_creds (const std::string &file, const std::string &username, const std::string &password, bool run_our_mouth) |
| Save user creds. | |
| std::string | http::url_escape (const std::string &url) |
| Percent-encode URL data for use in HTTP query strings. | |
| std::string | http::url_get_host (const std::string &url) |
| Extract the host component from a URL string. | |
| bool | http::user_creds_exist (const std::string &file) |
| Check whether the Web UI credentials file exists and is readable. | |
Variables | |
| net::net_e | http::origin_web_ui_allowed |
| Origin web ui allowed. | |
| std::string | http::unique_id |
| Unique ID. | |
Definitions for common HTTP.
| int http::create_creds | ( | const std::string & | pkey, |
| const std::string & | cert ) |
Generate HTTPS credential files from the provided key and certificate paths.
| pkey | Private key PEM data or private key file path. |
| cert | Certificate data or object used by the operation. |
| bool http::download_file | ( | const std::string & | url, |
| const std::string & | file, | ||
| long | ssl_version = CURL_SSLVERSION_TLSv1_2 ) |
Send a static file response for a Web UI request.
Download a URL to a local file using libcurl.
| url | URL used for the HTTP request. |
| file | Destination path for the downloaded content. |
| ssl_version | libcurl TLS version selector for the request. |
| int http::init | ( | ) |
Load persisted HTTP credentials and initialize shared request state.
Initialize shared HTTP client state.
| int http::reload_user_creds | ( | const std::string & | file | ) |
Reload the Web UI credentials from disk.
Reload Web UI user credentials from disk.
| file | Destination path for the downloaded content. |
| int http::save_user_creds | ( | const std::string & | file, |
| const std::string & | username, | ||
| const std::string & | password, | ||
| bool | run_our_mouth ) |
Save user creds.
| file | Credentials file path. |
| username | Username to save. |
| password | Password to save. |
| run_our_mouth | Whether to log user-facing status messages. |
| std::string http::url_escape | ( | const std::string & | url | ) |
Percent-encode URL data for use in HTTP query strings.
Percent-encode a string for safe inclusion in a URL.
| url | URL used for the HTTP request. |
| std::string http::url_get_host | ( | const std::string & | url | ) |
Extract the host component from a URL string.
Extract the host component from a URL.
| url | URL used for the HTTP request. |
| bool http::user_creds_exist | ( | const std::string & | file | ) |
Check whether the Web UI credentials file exists and is readable.
| file | Path to the credentials file. |