Blame docs/reference/gio/html/GProxy.html

Packit ae235b
Packit ae235b
<html>
Packit ae235b
<head>
Packit ae235b
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Packit ae235b
<title>GProxy: GIO Reference Manual</title>
Packit ae235b
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
Packit ae235b
<link rel="home" href="index.html" title="GIO Reference Manual">
Packit ae235b
<link rel="up" href="networking.html" title="Low-level network support">
Packit ae235b
<link rel="prev" href="GUnixCredentialsMessage.html" title="GUnixCredentialsMessage">
Packit ae235b
<link rel="next" href="GProxyAddress.html" title="GProxyAddress">
Packit ae235b
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
Packit ae235b
<link rel="stylesheet" href="style.css" type="text/css">
Packit ae235b
</head>
Packit ae235b
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit ae235b
Packit ae235b
Packit ae235b
Top  | 
Packit ae235b
                  Description  | 
Packit ae235b
                  Object Hierarchy  | 
Packit ae235b
                  Prerequisites
Packit ae235b
Packit ae235b
Home
Packit ae235b
Up
Packit ae235b
Prev
Packit ae235b
Next
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

GProxy

Packit ae235b

GProxy — Interface for proxy handling

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GIOStream *
Packit ae235b
Packit ae235b
Packit ae235b
g_proxy_connect ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
void
Packit ae235b
Packit ae235b
Packit ae235b
g_proxy_connect_async ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GIOStream *
Packit ae235b
Packit ae235b
Packit ae235b
g_proxy_connect_finish ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
GProxy *
Packit ae235b
Packit ae235b
Packit ae235b
g_proxy_get_default_for_protocol ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
gboolean
Packit ae235b
Packit ae235b
Packit ae235b
g_proxy_supports_hostname ()
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
 
Packit ae235b
GProxy
Packit ae235b
Packit ae235b
Packit ae235b
struct
Packit ae235b
GProxyInterface
Packit ae235b
Packit ae235b
Packit ae235b
#define
Packit ae235b
G_PROXY_EXTENSION_POINT_NAME
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Object Hierarchy

Packit ae235b
    GInterface
Packit ae235b
    ╰── GProxy
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Prerequisites

Packit ae235b

Packit ae235b
GProxy requires
Packit ae235b
 GObject.

Packit ae235b
Packit ae235b
Packit ae235b

Includes

Packit ae235b
#include <gio/gio.h>
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Description

Packit ae235b

A GProxy handles connecting to a remote host via a given type of

Packit ae235b
proxy server. It is implemented by the 'gio-proxy' extension point.
Packit ae235b
The extensions are named after their proxy protocol name. As an
Packit ae235b
example, a SOCKS5 proxy implementation can be retrieved with the
Packit ae235b
name 'socks5' using the function
Packit ae235b
g_io_extension_point_get_extension_by_name().

Packit ae235b
Packit ae235b
Packit ae235b

Functions

Packit ae235b
Packit ae235b

g_proxy_connect ()

Packit ae235b
GIOStream *
Packit ae235b
g_proxy_connect (GProxy *proxy,
Packit ae235b
                 GIOStream *connection,
Packit ae235b
                 GProxyAddress *proxy_address,
Packit ae235b
                 GCancellable *cancellable,
Packit ae235b
                 GError **error);
Packit ae235b

Given connection

Packit ae235b
 to communicate with a proxy (eg, a
Packit ae235b
GSocketConnection that is connected to the proxy server), this
Packit ae235b
does the necessary handshake to connect to proxy_address
Packit ae235b
, and if
Packit ae235b
required, wraps the GIOStream to handle proxy payload.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

proxy

Packit ae235b

a GProxy

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

connection

Packit ae235b

a GIOStream

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

proxy_address

Packit ae235b

a GProxyAddress

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

a GCancellable.

Packit ae235b
[nullable]
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

return GError

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

a GIOStream that will replace connection

Packit ae235b
. This might
Packit ae235b
be the same as connection
Packit ae235b
, in which case a reference
Packit ae235b
will be added. 

Packit ae235b

[transfer full]

Packit ae235b
Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_proxy_connect_async ()

Packit ae235b
void
Packit ae235b
g_proxy_connect_async (GProxy *proxy,
Packit ae235b
                       GIOStream *connection,
Packit ae235b
                       GProxyAddress *proxy_address,
Packit ae235b
                       GCancellable *cancellable,
Packit ae235b
                       GAsyncReadyCallback callback,
Packit ae235b
                       gpointer user_data);
Packit ae235b

Asynchronous version of g_proxy_connect().

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

proxy

Packit ae235b

a GProxy

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

connection

Packit ae235b

a GIOStream

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

proxy_address

Packit ae235b

a GProxyAddress

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

cancellable

Packit ae235b

a GCancellable.

Packit ae235b
[nullable]
Packit ae235b
Packit ae235b
Packit ae235b

callback

Packit ae235b

a GAsyncReadyCallback.

Packit ae235b
[scope async]
Packit ae235b
Packit ae235b
Packit ae235b

user_data

Packit ae235b

callback data.

Packit ae235b
[closure]
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_proxy_connect_finish ()

Packit ae235b
GIOStream *
Packit ae235b
g_proxy_connect_finish (GProxy *proxy,
Packit ae235b
                        GAsyncResult *result,
Packit ae235b
                        GError **error);
Packit ae235b

See g_proxy_connect().

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

proxy

Packit ae235b

a GProxy

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

result

Packit ae235b

a GAsyncResult

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

error

Packit ae235b

return GError

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

a GIOStream.

Packit ae235b

[transfer full]

Packit ae235b
Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_proxy_get_default_for_protocol ()

Packit ae235b
GProxy *
Packit ae235b
g_proxy_get_default_for_protocol (const gchar *protocol);
Packit ae235b

Lookup "gio-proxy" extension point for a proxy implementation that supports

Packit ae235b
specified protocol.

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

protocol

Packit ae235b

the proxy protocol name (e.g. http, socks, etc)

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

return a GProxy or NULL if protocol

Packit ae235b
is not supported. 

Packit ae235b

[transfer full]

Packit ae235b
Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

g_proxy_supports_hostname ()

Packit ae235b
gboolean
Packit ae235b
g_proxy_supports_hostname (GProxy *proxy);
Packit ae235b

Some proxy protocols expect to be passed a hostname, which they

Packit ae235b
will resolve to an IP address themselves. Others, like SOCKS4, do
Packit ae235b
not allow this. This function will return FALSE if proxy
Packit ae235b
 is
Packit ae235b
implementing such a protocol. When FALSE is returned, the caller
Packit ae235b
should resolve the destination hostname first, and then pass a
Packit ae235b
GProxyAddress containing the stringified IP address to
Packit ae235b
g_proxy_connect() or g_proxy_connect_async().

Packit ae235b
Packit ae235b

Parameters

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

proxy

Packit ae235b

a GProxy

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Returns

Packit ae235b

TRUE if hostname resolution is supported.

Packit ae235b
Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Types and Values

Packit ae235b
Packit ae235b

GProxy

Packit ae235b
typedef struct _GProxy GProxy;
Packit ae235b

Interface that handles proxy connection and payload.

Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

struct GProxyInterface

Packit ae235b
struct GProxyInterface {
Packit ae235b
  GTypeInterface g_iface;
Packit ae235b
Packit ae235b
  /* Virtual Table */
Packit ae235b
Packit ae235b
  GIOStream * (* connect)           (GProxy               *proxy,
Packit ae235b
				     GIOStream            *connection,
Packit ae235b
				     GProxyAddress        *proxy_address,
Packit ae235b
				     GCancellable         *cancellable,
Packit ae235b
				     GError              **error);
Packit ae235b
Packit ae235b
  void        (* connect_async)     (GProxy               *proxy,
Packit ae235b
				     GIOStream            *connection,
Packit ae235b
				     GProxyAddress	  *proxy_address,
Packit ae235b
				     GCancellable         *cancellable,
Packit ae235b
				     GAsyncReadyCallback   callback,
Packit ae235b
				     gpointer              user_data);
Packit ae235b
Packit ae235b
  GIOStream * (* connect_finish)    (GProxy               *proxy,
Packit ae235b
				     GAsyncResult         *result,
Packit ae235b
				     GError              **error);
Packit ae235b
Packit ae235b
  gboolean    (* supports_hostname) (GProxy             *proxy);
Packit ae235b
};
Packit ae235b
Packit ae235b

Provides an interface for handling proxy connection and payload.

Packit ae235b
Packit ae235b

Members

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

connect ()

Packit ae235b

Connect to proxy server and wrap (if required) the connection

Packit ae235b
to handle payload.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

connect_async ()

Packit ae235b

Same as connect() but asynchronous.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

connect_finish ()

Packit ae235b

Returns the result of connect_async()

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b

supports_hostname ()

Packit ae235b

Returns whether the proxy supports hostname lookups.

Packit ae235b
 
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b

Packit ae235b
Packit ae235b

G_PROXY_EXTENSION_POINT_NAME

Packit ae235b
#define G_PROXY_EXTENSION_POINT_NAME "gio-proxy"
Packit ae235b
Packit ae235b

Extension point for proxy functionality.

Packit ae235b
See Extending GIO.

Packit ae235b

Since: 2.26

Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b
Packit ae235b

Generated by GTK-Doc V1.27
Packit ae235b
</body>
Packit ae235b
</html>