Proxy Support

Proxy Support — Functions for determining proxy support.

Synopsis




enum        GNetworkTcpProxyType;
gboolean    gnetwork_tcp_proxy_get_use_proxy
                                            (GNetworkTcpProxyType type,
                                             const gchar *address);

Description

The GNetwork library automatically forwards outgoing connections through configured proxy servers. The configuration is stored in GConf, and GNetwork reads the same configuration as GnomeVFS, and by extension, the GNOME Desktop.

The GConf keys used to store proxy settings are:

KeyTypeDescription
/system/http_proxy/use_http_proxyBooleanUse a proxy server to connect to HTTP servers.
/system/http_proxy/hostStringThe hostname of the HTTP proxy server.
/system/http_proxy/portIntegerThe port of the HTTP proxy server defined in /system/http_proxy/host.
/system/http_proxy/use_authenticationBooleanAuthenticate when using the HTTP proxy server.
/system/http_proxy/authentication_userStringThe username to use when authenticating with the HTTP proxy server defined in /system/http_proxy/host.
/system/http_proxy/authentication_passwordStringThe password to use when authenticating with the HTTP proxy server defined in /system/http_proxy/host.
/system/http_proxy/ignore_hostsString ListWhich hostnames to always connect to directly.
/system/proxy/ftp_hostStringThe hostname of the FTP proxy server.
/system/proxy/ftp_portIntegerThe port of the FTP proxy server defined in /system/proxy/ftp_host.
/system/proxy/secure_hostStringThe hostname of the SSL proxy server.
/system/proxy/secure_portIntegerThe port of the SSL proxy server defined in /system/proxy/secure_host.
/system/proxy/socks_hostStringThe hostname of the SOCKS proxy server.
/system/proxy/socks_portIntegerThe port of the SOCKS proxy server defined in /system/proxy/socks_host.
/system/proxy/socks_versionIntegerThe version of the SOCKS proxy server defined in /system/proxy/socks_host.

Details

enum GNetworkTcpProxyType

typedef enum			/* < prefix=GNETWORK_TCP_PROXY > */
{
  GNETWORK_TCP_PROXY_HTTP,
  GNETWORK_TCP_PROXY_HTTPS,
  GNETWORK_TCP_PROXY_FTP,
  GNETWORK_TCP_PROXY_SOCKS,

  GNETWORK_TCP_PROXY_NONE
}
GNetworkTcpProxyType;

An enumeration of the supported proxy types.

GNETWORK_TCP_PROXY_HTTPa generic proxy server intended for HTTP connections.
GNETWORK_TCP_PROXY_HTTPSa generic proxy server intended for secure HTTP connections.
GNETWORK_TCP_PROXY_FTPa proxy for FTP connections
GNETWORK_TCP_PROXY_SOCKSa proxy for all other connections
GNETWORK_TCP_PROXY_NONEno proxy (should not be used).

gnetwork_tcp_proxy_get_use_proxy ()

gboolean    gnetwork_tcp_proxy_get_use_proxy
                                            (GNetworkTcpProxyType type,
                                             const gchar *address);

This function checks type and address, and returns TRUE if a proxy will be used, or FALSE, if one won't. This is useful if you need to check to see if you can create a GNetworkServer without problems.

type : the type of proxy for this connection.
address : the remote address to check the proxy for.
Returns : a gboolean if a proxy will be used for this connection.

Since 1.0