## LmProxy

LmProxy — API for the proxy support in Loudmouth

## Functions

LmProxy * | lm_proxy_new ()
LmProxy * | lm_proxy_new_with_server ()
LmProxyType | lm_proxy_get_type ()
void | lm_proxy_set_type ()
const gchar * | lm_proxy_get_server ()
void | lm_proxy_set_server ()
guint | lm_proxy_get_port ()
void | lm_proxy_set_port ()
const gchar * | lm_proxy_get_username ()
void | lm_proxy_set_username ()
const gchar * | lm_proxy_get_password ()
void | lm_proxy_set_password ()
LmProxy * | lm_proxy_ref ()
void | lm_proxy_unref ()

## Types and Values

| LmProxy
enum | LmProxyType

## Description

Use this together with an LmConnection to get the connection to use connect through a proxy. Example of how to use the LmProxy API.

    1
    2
    3
    4
    5
    6
    7
    8
    9

    LmConnection *connection;
    LmProxy      *proxy;

    connection = lm_connection_new ("myserver");
    proxy = lm_proxy_new_with_server (LM_PROXY_TYPE_HTTP,
                   "myproxyserver",
                   8080);
    lm_connection_set_proxy (connection, proxy);
    ...

## Functions

### lm_proxy_new ()

    LmProxy *
    lm_proxy_new (LmProxyType type);

Creates a new Proxy. Used lm_connection_set_proxy to make a connection user this proxy.

#### Parameters

type | the type of the new proxy |

#### Returns

a newly create proxy

### lm_proxy_new_with_server ()

    LmProxy *
    lm_proxy_new_with_server (LmProxyType type,
                              const gchar *server,
                              guint port);

Creates a new Proxy. Use lm_connection_set_proxy to make a connection user this proxy.

#### Parameters

type | the type of the new proxy |
server | the proxy server |
port | the proxy server port |

#### Returns

a newly create proxy

### lm_proxy_get_type ()

    LmProxyType
    lm_proxy_get_type (LmProxy *proxy);

Fetches the proxy type

#### Parameters

proxy | an LmProxy |

#### Returns

the type

### lm_proxy_set_type ()

    void
    lm_proxy_set_type (LmProxy *proxy,
                       LmProxyType type);

Sets the proxy type for `proxy` to `type` .

#### Parameters

proxy | an LmProxy |
type | an LmProxyType |

### lm_proxy_get_server ()

    const gchar *
    lm_proxy_get_server (LmProxy *proxy);

Fetches the server address that `proxy` is using.

#### Parameters

proxy | an LmProxy |

#### Returns

the proxy server address

### lm_proxy_set_server ()

    void
    lm_proxy_set_server (LmProxy *proxy,
                         const gchar *server);

Sets the server address for `proxy` to `server` .

#### Parameters

proxy | an LmProxy |
server | Address of the proxy server |

### lm_proxy_get_port ()

    guint
    lm_proxy_get_port (LmProxy *proxy);

Fetches the port that `proxy` is using.

#### Parameters

proxy | an LmProxy |

#### Returns

The port

### lm_proxy_set_port ()

    void
    lm_proxy_set_port (LmProxy *proxy,
                       guint port);

Sets the server port that `proxy` will be using.

#### Parameters

proxy | an LmProxy |
port | proxy server port |

### lm_proxy_get_username ()

    const gchar *
    lm_proxy_get_username (LmProxy *proxy);

Fetches the username that `proxy` is using.

#### Parameters

proxy | an LmProxy |

#### Returns

the username

### lm_proxy_set_username ()

    void
    lm_proxy_set_username (LmProxy *proxy,
                           const gchar *username);

Sets the username for `proxy` to `username` or `NULL` to unset.

#### Parameters

proxy | an LmProxy |
username | Username |

### lm_proxy_get_password ()

    const gchar *
    lm_proxy_get_password (LmProxy *proxy);

Fetches the password that `proxy` is using.

#### Parameters

proxy | an LmProxy |

#### Returns

the proxy password

### lm_proxy_set_password ()

    void
    lm_proxy_set_password (LmProxy *proxy,
                           const gchar *password);

Sets the password for `proxy` to `password` or `NULL` to unset.

#### Parameters

proxy | an LmProxy |
password | Password |

### lm_proxy_ref ()

    LmProxy *
    lm_proxy_ref (LmProxy *proxy);

Adds a reference to `proxy` .

#### Parameters

proxy | an LmProxy |

#### Returns

the proxy

### lm_proxy_unref ()

    void
    lm_proxy_unref (LmProxy *proxy);

Removes a reference from `proxy` . When no more references are present `proxy` is freed.

#### Parameters

proxy | an LmProxy |

## Types and Values

### LmProxy

    typedef struct _LmProxy LmProxy;

This should not be accessed directly. Use the accessor functions as described below.

### enum LmProxyType

The type of the proxy.

#### Members

LM_PROXY_TYPE_NONE | Unused |
LM_PROXY_TYPE_HTTP | An HTTP proxy. |