pub struct NetworkProxySettings { /* private fields */ }Expand description
Configures network proxies.
WebKitNetworkProxySettings can be used to provide a custom proxy configuration
to a NetworkSession. You need to call webkit_network_session_set_network_proxy_settings()
with NetworkProxyMode::Custom and a WebKitNetworkProxySettings.
GLib type: Boxed type with copy-on-clone semantics.
Implementations§
Source§impl NetworkProxySettings
impl NetworkProxySettings
Sourcepub fn as_ptr(&self) -> *mut WebKitNetworkProxySettings
pub fn as_ptr(&self) -> *mut WebKitNetworkProxySettings
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(
ptr: &*mut WebKitNetworkProxySettings,
) -> &Self
pub unsafe fn from_glib_ptr_borrow( ptr: &*mut WebKitNetworkProxySettings, ) -> &Self
Borrows the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow_mut(
ptr: &mut *mut WebKitNetworkProxySettings,
) -> &mut Self
pub unsafe fn from_glib_ptr_borrow_mut( ptr: &mut *mut WebKitNetworkProxySettings, ) -> &mut Self
Borrows the underlying C value mutably.
Source§impl NetworkProxySettings
impl NetworkProxySettings
Sourcepub fn new(
default_proxy_uri: Option<&str>,
ignore_hosts: &[&str],
) -> NetworkProxySettings
pub fn new( default_proxy_uri: Option<&str>, ignore_hosts: &[&str], ) -> NetworkProxySettings
Create a new NetworkProxySettings with the given default_proxy_uri and ignore_hosts.
The default proxy URI will be used for any URI that doesn’t match ignore_hosts, and doesn’t match any
of the schemes added with add_proxy_for_scheme().
If default_proxy_uri starts with “socks://”, it will be treated as referring to all three of the
socks5, socks4a, and socks4 proxy types.
ignore_hosts is a list of hostnames and IP addresses that the resolver should allow direct connections to.
Entries can be in one of 4 formats:
<itemizedlist>
<listitem>``<para>
A hostname, such as “example.com”, “.example.com”, or “*.example.com”, any of which match “example.com” or
any subdomain of it.
</para>``</listitem>
<listitem>``<para>
An IPv4 or IPv6 address, such as “192.168.1.1”, which matches only that address.
</para>``</listitem>
<listitem>``<para>
A hostname or IP address followed by a port, such as “example.com:80”, which matches whatever the hostname or IP
address would match, but only for URLs with the (explicitly) indicated port. In the case of an IPv6 address, the address
part must appear in brackets: “[::1]:443”
</para>``</listitem>
<listitem>``<para>
An IP address range, given by a base address and prefix length, such as “fe80::/10”, which matches any address in that range.
</para>``</listitem>
</itemizedlist>
Note that when dealing with Unicode hostnames, the matching is done against the ASCII form of the name.
Also note that hostname exclusions apply only to connections made to hosts identified by name, and IP address exclusions apply only
to connections made to hosts identified by address. That is, if example.com has an address of 192.168.1.1, and ignore_hosts
contains only “192.168.1.1”, then a connection to “example.com” will use the proxy, and a connection to 192.168.1.1“ will not.
§default_proxy_uri
the default proxy URI to use, or None.
§ignore_hosts
an optional list of hosts/IP addresses to not use a proxy for.
§Returns
A new NetworkProxySettings.
Sourcepub fn add_proxy_for_scheme(&mut self, scheme: &str, proxy_uri: &str)
pub fn add_proxy_for_scheme(&mut self, scheme: &str, proxy_uri: &str)
Adds a URI-scheme-specific proxy.
URIs whose scheme matches uri_scheme will be proxied via proxy_uri.
As with the default proxy URI, if proxy_uri starts with “socks://”, it will be treated as referring to
all three of the socks5, socks4a, and socks4 proxy types.
§scheme
the URI scheme to add a proxy for
§proxy_uri
the proxy URI to use for uri_scheme
Trait Implementations§
Source§impl Clone for NetworkProxySettings
impl Clone for NetworkProxySettings
Source§impl Debug for NetworkProxySettings
impl Debug for NetworkProxySettings
Source§impl From<NetworkProxySettings> for Value
impl From<NetworkProxySettings> for Value
Source§fn from(o: NetworkProxySettings) -> Self
fn from(o: NetworkProxySettings) -> Self
Source§impl HasParamSpec for NetworkProxySettings
impl HasParamSpec for NetworkProxySettings
type ParamSpec = ParamSpecBoxed
Source§type SetValue = NetworkProxySettings
type SetValue = NetworkProxySettings
type BuilderFn = fn(&str) -> ParamSpecBoxedBuilder<'_, NetworkProxySettings>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for NetworkProxySettings
impl Hash for NetworkProxySettings
Source§impl Ord for NetworkProxySettings
impl Ord for NetworkProxySettings
Source§fn cmp(&self, other: &NetworkProxySettings) -> Ordering
fn cmp(&self, other: &NetworkProxySettings) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NetworkProxySettings
impl PartialEq for NetworkProxySettings
Source§impl PartialOrd for NetworkProxySettings
impl PartialOrd for NetworkProxySettings
Source§impl StaticType for NetworkProxySettings
impl StaticType for NetworkProxySettings
Source§fn static_type() -> Type
fn static_type() -> Type
Self.