Add proxy support for HTTPClient and the editor

* Adds proxy related methods for `HTTPClient` and `HTTPRequest`
* Adds `network/http_proxy/{host,port}` editor settings
* Makes AssetLib and Export Template Manager proxy aware
This commit is contained in:
Haoyu Qiu 2021-12-16 18:43:29 +08:00
parent 3f137fb3a9
commit 1cada6bfa9
8 changed files with 186 additions and 12 deletions

View file

@ -150,6 +150,11 @@ void ExportTemplateManager::_download_template(const String &p_url, bool p_skip_
download_templates->set_download_file(EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp_templates.tpz"));
download_templates->set_use_threads(true);
const String proxy_host = EDITOR_DEF("network/http_proxy/host", "");
const int proxy_port = EDITOR_DEF("network/http_proxy/port", -1);
download_templates->set_http_proxy(proxy_host, proxy_port);
download_templates->set_https_proxy(proxy_host, proxy_port);
Error err = download_templates->request(p_url);
if (err != OK) {
_set_current_progress_status(TTR("Error requesting URL:") + " " + p_url, true);