Adds proxy support for HTTPClient
Also fixed a potential infinite loop when connecting to server.
This commit is contained in:
@ -49,6 +49,14 @@ HTTPClient *HTTPClient::create() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void HTTPClient::set_http_proxy(const String &p_host, int p_port) {
|
||||
WARN_PRINT("HTTP proxy feature is not available");
|
||||
}
|
||||
|
||||
void HTTPClient::set_https_proxy(const String &p_host, int p_port) {
|
||||
WARN_PRINT("HTTPS proxy feature is not available");
|
||||
}
|
||||
|
||||
Error HTTPClient::_request_raw(Method p_method, const String &p_url, const Vector<String> &p_headers, const Vector<uint8_t> &p_body) {
|
||||
int size = p_body.size();
|
||||
return request(p_method, p_url, p_headers, size > 0 ? p_body.ptr() : nullptr, size);
|
||||
@ -142,6 +150,9 @@ void HTTPClient::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("get_status"), &HTTPClient::get_status);
|
||||
ClassDB::bind_method(D_METHOD("poll"), &HTTPClient::poll);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_http_proxy", "host", "port"), &HTTPClient::set_http_proxy);
|
||||
ClassDB::bind_method(D_METHOD("set_https_proxy", "host", "port"), &HTTPClient::set_https_proxy);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("query_string_from_dict", "fields"), &HTTPClient::query_string_from_dict);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "blocking_mode_enabled"), "set_blocking_mode", "is_blocking_mode_enabled");
|
||||
|
||||
Reference in New Issue
Block a user