2.28 <GProxy>

Interface: <GProxy>

A <GProxy> handles connecting to a remote host via a given type of proxy server. It is implemented by the gio-proxy extension point. The extensions are named after their proxy protocol name. As an example, a SOCKS5 proxy implementation can be retrieved with the name socks5 using the function Gio.IOExtensionPoint.get_extension_by_name.

Procedures

Method: proxy:connect self connection proxy-address [cancellable] ⇒ %return
Method: connect self connection proxy-address [cancellable] ⇒ %return

Given connection to communicate with a proxy (eg, a <GSocketConnection> that is connected to the proxy server), this does the necessary handshake to connect to proxy-address, and if required, wraps the <GIOStream> to handle proxy payload.

self

Passed: a <GProxy>.

a <GProxy>

connection

Passed: a <GIOStream>.

a <GIOStream>

proxy-address

Passed: a <GProxyAddress>.

a <GProxyAddress>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

%return

Returned: a <GIOStream>.

a <GIOStream> that will replace connection. This might be the same as connection, in which case a reference will be added.

Method: proxy:connect-async self connection proxy-address [cancellable] [callback]
Method: connect-async self connection proxy-address [cancellable] [callback]

Asynchronous version of proxy:connect.

self

Passed: a <GProxy>.

a <GProxy>

connection

Passed: a <GIOStream>.

a <GIOStream>

proxy-address

Passed: a <GProxyAddress>.

a <GProxyAddress>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

callback data

Method: proxy:connect-finish self result ⇒ %return
Method: connect-finish self result ⇒ %return

See proxy:connect.

self

Passed: a <GProxy>.

a <GProxy>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a <GIOStream>.

a <GIOStream>.

Procedure: proxy:get-default-for-protocol protocol ⇒ %return

Find the gio-proxy extension point for a proxy implementation that supports the specified protocol.

protocol

Passed: a string.

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

%return

Returned: a <GProxy>, or #f.

return a <GProxy> or NULL if protocol is not supported.

Method: proxy:supports-hostname? self ⇒ %return
Method: supports-hostname? self ⇒ %return

Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return #f if self is implementing such a protocol. When #f is returned, the caller should resolve the destination hostname first, and then pass a <GProxyAddress> containing the stringified IP address to proxy:connect or proxy:connect-async.

self

Passed: a <GProxy>.

a <GProxy>

%return

Returned: a boolean.

#t if hostname resolution is supported.

Virtual methods

Virtual method: proxy:do-connect implementor self connection proxy-address [cancellable] ⇒ %return

Given connection to communicate with a proxy (eg, a <GSocketConnection> that is connected to the proxy server), this does the necessary handshake to connect to proxy-address, and if required, wraps the <GIOStream> to handle proxy payload.

To override it in a new class, give register-type #:vfuncs `((connect . ,procedure)). The procedure is called as (procedure self connection proxy-address cancellable) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GProxy>, or its GType number.

self

Passed: a <GProxy>.

a <GProxy>

connection

Passed: a <GIOStream>.

a <GIOStream>

proxy-address

Passed: a <GProxyAddress>.

a <GProxyAddress>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

%return

Returned: a <GIOStream>.

a <GIOStream> that will replace connection. This might be the same as connection, in which case a reference will be added.

Virtual method: proxy:do-connect-async implementor self connection proxy-address [cancellable] [callback]

Asynchronous version of proxy:connect.

To override it in a new class, give register-type #:vfuncs `((connect-async . ,procedure)). The procedure is called as (procedure self connection proxy-address cancellable callback user-data).

implementor

Passed: the class whose implementation to call: a class that implements <GProxy>, or its GType number.

self

Passed: a <GProxy>.

a <GProxy>

connection

Passed: a <GIOStream>.

a <GIOStream>

proxy-address

Passed: a <GProxyAddress>.

a <GProxyAddress>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable>

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

callback data

Virtual method: proxy:do-connect-finish implementor self result ⇒ %return

See proxy:connect.

To override it in a new class, give register-type #:vfuncs `((connect-finish . ,procedure)). The procedure is called as (procedure self result) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GProxy>, or its GType number.

self

Passed: a <GProxy>.

a <GProxy>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a <GIOStream>.

a <GIOStream>.

Virtual method: proxy:do-supports-hostname implementor self ⇒ %return

Some proxy protocols expect to be passed a hostname, which they will resolve to an IP address themselves. Others, like SOCKS4, do not allow this. This function will return #f if self is implementing such a protocol. When #f is returned, the caller should resolve the destination hostname first, and then pass a <GProxyAddress> containing the stringified IP address to proxy:connect or proxy:connect-async.

To override it in a new class, give register-type #:vfuncs `((supports-hostname . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GProxy>, or its GType number.

self

Passed: a <GProxy>.

a <GProxy>

%return

Returned: a boolean.

#t if hostname resolution is supported.