package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Proxy

type t = [ `proxy ] Gobject.obj
val from_gobject : 'a Gobject.obj -> t
val supports_hostname : t -> bool

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 %FALSE if @proxy is implementing such a protocol. When %FALSE is returned, the caller should resolve the destination hostname first, and then pass a #GProxyAddress containing the stringified IP address to g_proxy_connect() or g_proxy_connect_async().

val connect_finish : t -> [ `async_result ] Gobject.obj -> ([ `io_stream | `object_ ] Gobject.obj, GError.t) result

See g_proxy_connect().

val connect : t -> [ `io_stream | `object_ ] Gobject.obj -> [ `proxy_address | `inet_socket_address | `socket_address | `object_ ] Gobject.obj -> [ `cancellable | `object_ ] Gobject.obj option -> ([ `io_stream | `object_ ] Gobject.obj, GError.t) result

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.