|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Declarations for common HTTP. More...
Go to the source code of this file.
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. | |
Declarations 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. |