Version: 3.3.0
wxWebProxy Class Reference

#include <wx/webrequest.h>

Detailed Description

Object describing the proxy settings to be used by the session.

An object of this type can be created using one of the factory functions documented below and passed to wxWebSession::SetProxy() or wxWebSessionSync::SetProxy() to use non-default proxy settings.

For example:

auto& session = wxWebSession::GetDefault();
if ( !session.SetProxy(wxWebProxy::FromURL("http://proxy.example.com:8080")) )
{
// proxy couldn't be set, maybe try with another one?
}
static wxWebProxy FromURL(const wxString &url)
Use the specified proxy for all requests.
static wxWebSession & GetDefault()
Returns the default session.
Note
Support for specifying the proxy is not implemented under iOS due to the platform limitations.
Since
3.3.0

Library:  wxNet
Category:  Networking

Static Public Member Functions

static wxWebProxy FromURL (const wxString &url)
 Use the specified proxy for all requests. More...
 
static wxWebProxy Disable ()
 Disable use of the proxy even if one is configured. More...
 
static wxWebProxy Default ()
 

Member Function Documentation

◆ Default()

static wxWebProxy wxWebProxy::Default ( )
static

◆ Disable()

static wxWebProxy wxWebProxy::Disable ( )
static

Disable use of the proxy even if one is configured.

Try to always use direct connection to the server, even if the system, or user account, is configured to use a proxy.

◆ FromURL()

static wxWebProxy wxWebProxy::FromURL ( const wxString url)
static

Use the specified proxy for all requests.

The url may contain the schema (supported schemas depend on the backend, but "http" and "https" are always supported) and the port number, but "http" and backend-dependent port number will be used by default if they are not specified.

It may also contain username and password to be used for authenticating with the proxy, except under macOS.

Backend-specific notes:

  • WinHTTP: only "http" and "https" schemas are supported, the default port numbers are 80 and 443, respectively.
  • NSURLSession: Same as for WinHTTP with the added limitation that the URL may not contain the username and password nor the path, i.e. it is limited to just the host name and port.
  • CURL: all schemas supported by libcurl are supported, which also includes "socks4" and "socks5", the default port is 1080.