Gio.ProxyAddress.new
Description: Reference for Gio.ProxyAddress.new

### Constructor

# Gio ProxyAddressnew

since: 2.26

#### Declaration

    GSocketAddress*
    g_proxy_address_new (
      GInetAddress* inetaddr,
      guint16 port,
      const gchar* protocol,
      const gchar* dest_hostname,
      guint16 dest_port,
      const gchar* username,
      const gchar* password
    )

#### Description

Creates a new `GProxyAddress` for `inetaddr` with `protocol` that should tunnel through `dest_hostname` and `dest_port`.

(Note that this method doesn’t set the `GProxyAddress:uri` or `GProxyAddress:destination-protocol` fields; use `g_object_new()` directly if you want to set those.)

Available since: 2.26

#### Parameters

`inetaddr`

  Type: `GInetAddress`

  The proxy server `GInetAddress`.

  The data is owned by the caller of the function.

`port`

  Type: `guint16`

  The proxy server port.

`protocol`

  Type: `const gchar*`

  The proxy protocol to support, in lower case (e.g. socks, http).

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`dest_hostname`

  Type: `const gchar*`

  The destination hostname the proxy should tunnel to.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`dest_port`

  Type: `guint16`

  The destination port to tunnel to.

`username`

  Type: `const gchar*`

  The username to authenticate to the proxy server (or `NULL`).

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`password`

  Type: `const gchar*`

  The password to authenticate to the proxy server (or `NULL`).

  The argument can be `NULL`.
  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `GSocketAddress`

A new `GProxyAddress`.

The caller of the function takes ownership of the data, and is responsible for freeing it.