Ecore Connection SOCKS functions

Data Structures | Typedefs | Functions
Ecore Connection SOCKS functions
Ecore » Ecore_Con - Connection functions

## Data Structures
struct | _Ecore_Con_Event_Proxy_Bind
| Used as the `data` param for the ECORE_CON_EVENT_PROXY_BIND event. More...

## Typedefs
typedef struct Ecore_Con_Socks | Ecore_Con_Socks
| An object representing a SOCKS proxy. More...

## Functions
EAPI Ecore_Con_Socks * | ecore_con_socks4_remote_add (const char *ip, int port, const char *username)
| Add a SOCKS v4 proxy to the proxy list. More...
EAPI Eina_Bool | ecore_con_socks4_remote_exists (const char *ip, int port, const char *username)
| Find a SOCKS v4 proxy in the proxy list. More...
EAPI void | ecore_con_socks4_remote_del (const char *ip, int port, const char *username)
| Remove a SOCKS v4 proxy from the proxy list and delete it. More...
EAPI Ecore_Con_Socks * | ecore_con_socks5_remote_add (const char *ip, int port, const char *username, const char *password)
| Add a SOCKS v5 proxy to the proxy list. More...
EAPI Eina_Bool | ecore_con_socks5_remote_exists (const char *ip, int port, const char *username, const char *password)
| Find a SOCKS v5 proxy in the proxy list. More...
EAPI void | ecore_con_socks5_remote_del (const char *ip, int port, const char *username, const char *password)
| Remove a SOCKS v5 proxy from the proxy list and delete it. More...
EAPI void | ecore_con_socks_lookup_set (Ecore_Con_Socks *ecs, Eina_Bool enable)
| Set DNS lookup mode on an existing SOCKS proxy. More...
EAPI Eina_Bool | ecore_con_socks_lookup_get (Ecore_Con_Socks *ecs)
| Get DNS lookup mode on an existing SOCKS proxy. More...
EAPI void | ecore_con_socks_bind_set (Ecore_Con_Socks *ecs, Eina_Bool is_bind)
| Enable bind mode on a SOCKS proxy. More...
EAPI Eina_Bool | ecore_con_socks_bind_get (Ecore_Con_Socks *ecs)
| Return bind mode of a SOCKS proxy. More...
EAPI unsigned int | ecore_con_socks_version_get (Ecore_Con_Socks *ecs)
| Return SOCKS version of a SOCKS proxy. More...
EAPI void | ecore_con_socks_remote_del (Ecore_Con_Socks *ecs)
| Remove a SOCKS v4 proxy from the proxy list and delete it. More...
EAPI void | ecore_con_socks_apply_once (Ecore_Con_Socks *ecs)
| Set a proxy object to be used with the next server created with ecore_con_server_connect() More...
EAPI void | ecore_con_socks_apply_always (Ecore_Con_Socks *ecs)
| Set a proxy object to be used with all servers created with ecore_con_server_connect() More...

## Detailed Description

## Typedef Documentation

## ◆ Ecore_Con_Socks

Ecore_Con_Socks

An object representing a SOCKS proxy.

Since
  1.2

## Function Documentation

## ◆ ecore_con_socks4_remote_add()

EAPI Ecore_Con_Socks* ecore_con_socks4_remote_add | ( | const char * | ip,
|  | int | port,
|  | const char * | username
| ) |  |

Add a SOCKS v4 proxy to the proxy list.

Use this to create (or return, if previously added) a SOCKS proxy object which can be used by any ecore_con servers.

Parameters

  ip | The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
  port | The port to connect to on the proxy
  username | The username to use for the proxy (OPTIONAL)

Returns
  An allocated proxy object, or NULL on failure

Note
  This object NEVER needs to be explicitly freed.

Since
  1.2

References eina_list_append(), and eina_stringshare_add().

## ◆ ecore_con_socks4_remote_exists()

EAPI Eina_Bool ecore_con_socks4_remote_exists | ( | const char * | ip,
|  | int | port,
|  | const char * | username
| ) |  |

Find a SOCKS v4 proxy in the proxy list.

Use this to determine if a SOCKS proxy was previously added by checking the proxy list against the parameters given.

Parameters

  ip | The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
  port | The port to connect to on the proxy, or -1 to match the first proxy with `ip`
  username | The username used for the proxy (OPTIONAL)

Returns
  true only if a proxy exists matching the given params

Note
  This function matches slightly more loosely than ecore_con_socks4_remote_add(), and ecore_con_socks4_remote_add() should be used to return the actual object.

Since
  1.2

References EINA_FALSE.

## ◆ ecore_con_socks4_remote_del()

EAPI void ecore_con_socks4_remote_del | ( | const char * | ip,
|  | int | port,
|  | const char * | username
| ) |  |

Remove a SOCKS v4 proxy from the proxy list and delete it.

Use this to remove a SOCKS proxy from the proxy list by checking the list against the parameters given. The proxy will then be deleted.

Parameters

  ip | The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
  port | The port to connect to on the proxy, or -1 to match the first proxy with `ip`
  username | The username used for the proxy (OPTIONAL)

Note
  This function matches in the same way as ecore_con_socks4_remote_exists().

Warning
  Be aware that deleting a proxy which is being used WILL ruin your life.

Since
  1.2

References eina_list_remove().

## ◆ ecore_con_socks5_remote_add()

EAPI Ecore_Con_Socks* ecore_con_socks5_remote_add | ( | const char * | ip,
|  | int | port,
|  | const char * | username,
|  | const char * | password
| ) |  |

Add a SOCKS v5 proxy to the proxy list.

Use this to create (or return, if previously added) a SOCKS proxy object which can be used by any ecore_con servers.

Parameters

  ip | The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
  port | The port to connect to on the proxy
  username | The username to use for the proxy (OPTIONAL)
  password | The password to use for the proxy (OPTIONAL)

Returns
  An allocated proxy object, or NULL on failure

Note
  This object NEVER needs to be explicitly freed.

Since
  1.2

References eina_list_append(), and eina_stringshare_add().

## ◆ ecore_con_socks5_remote_exists()

EAPI Eina_Bool ecore_con_socks5_remote_exists | ( | const char * | ip,
|  | int | port,
|  | const char * | username,
|  | const char * | password
| ) |  |

Find a SOCKS v5 proxy in the proxy list.

Use this to determine if a SOCKS proxy was previously added by checking the proxy list against the parameters given.

Parameters

  ip | The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
  port | The port to connect to on the proxy, or -1 to match the first proxy with `ip`
  username | The username used for the proxy (OPTIONAL)
  password | The password used for the proxy (OPTIONAL)

Returns
  true only if a proxy exists matching the given params

Note
  This function matches slightly more loosely than ecore_con_socks5_remote_add(), and ecore_con_socks5_remote_add() should be used to return the actual object.

Since
  1.2

References EINA_FALSE.

## ◆ ecore_con_socks5_remote_del()

EAPI void ecore_con_socks5_remote_del | ( | const char * | ip,
|  | int | port,
|  | const char * | username,
|  | const char * | password
| ) |  |

Remove a SOCKS v5 proxy from the proxy list and delete it.

Use this to remove a SOCKS proxy from the proxy list by checking the list against the parameters given. The proxy will then be deleted.

Parameters

  ip | The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
  port | The port to connect to on the proxy, or -1 to match the first proxy with `ip`
  username | The username used for the proxy (OPTIONAL)
  password | The password used for the proxy (OPTIONAL)

Note
  This function matches in the same way as ecore_con_socks4_remote_exists().

Warning
  Be aware that deleting a proxy which is being used WILL ruin your life.

Since
  1.2

References eina_list_remove().

## ◆ ecore_con_socks_lookup_set()

EAPI void ecore_con_socks_lookup_set | ( | Ecore_Con_Socks * | ecs,
|  | Eina_Bool | enable
| ) |  |

Set DNS lookup mode on an existing SOCKS proxy.

According to RFC, SOCKS v4 does not require that a proxy perform its own DNS lookups for addresses. SOCKS v4a specifies the protocol for this. SOCKS v5 allows DNS lookups. If you want to enable remote DNS lookup and are sure that your proxy supports it, use this function.

Parameters

  ecs | The proxy object
  enable | If true, the proxy will perform the dns lookup

Note
  By default, this setting is DISABLED.

Since
  1.2

## ◆ ecore_con_socks_lookup_get()

EAPI Eina_Bool ecore_con_socks_lookup_get | ( | Ecore_Con_Socks * | ecs | ) |

Get DNS lookup mode on an existing SOCKS proxy.

According to RFC, SOCKS v4 does not require that a proxy perform its own DNS lookups for addresses. SOCKS v4a specifies the protocol for this. SOCKS v5 allows DNS lookups. This function returns whether lookups are enabled on a proxy object.

Parameters

  ecs | The proxy object

Returns
  If true, the proxy will perform the dns lookup

Note
  By default, this setting is DISABLED.

Since
  1.2

References EINA_FALSE.

## ◆ ecore_con_socks_bind_set()

EAPI void ecore_con_socks_bind_set | ( | Ecore_Con_Socks * | ecs,
|  | Eina_Bool | is_bind
| ) |  |

Enable bind mode on a SOCKS proxy.

Use this function to enable binding a remote port for use with a remote server. For more information, see http://ufasoft.com/doc/socks4_protocol.htm

Parameters

  ecs | The proxy object
  is_bind | If true, the connection established will be a port binding

Warning
  Be aware that changing the operation mode of an active proxy may result in undefined behavior

Since
  1.2

## ◆ ecore_con_socks_bind_get()

EAPI Eina_Bool ecore_con_socks_bind_get | ( | Ecore_Con_Socks * | ecs | ) |

Return bind mode of a SOCKS proxy.

Use this function to return bind mode of a proxy (binding a remote port for use with a remote server). For more information, see http://ufasoft.com/doc/socks4_protocol.htm

Parameters

  ecs | The proxy object

Returns
  If true, the connection established will be a port binding

Since
  1.2

## ◆ ecore_con_socks_version_get()

EAPI unsigned int ecore_con_socks_version_get | ( | Ecore_Con_Socks * | ecs | ) |

Return SOCKS version of a SOCKS proxy.

Use this function to return the SOCKS protocol version of a proxy

Parameters

  ecs | The proxy object

Returns
  0 on error, else 4/5

Since
  1.2

## ◆ ecore_con_socks_remote_del()

EAPI void ecore_con_socks_remote_del | ( | Ecore_Con_Socks * | ecs | ) |

Remove a SOCKS v4 proxy from the proxy list and delete it.

Use this to remove a SOCKS proxy from the proxy list by directly deleting the object given.

Parameters

  ecs | The proxy object to delete

Warning
  Be aware that deleting a proxy which is being used WILL ruin your life.

Since
  1.2

## ◆ ecore_con_socks_apply_once()

EAPI void ecore_con_socks_apply_once | ( | Ecore_Con_Socks * | ecs | ) |

Set a proxy object to be used with the next server created with ecore_con_server_connect()

This function sets a proxy for the next ecore_con connection. After the next server is created, the proxy will NEVER be applied again unless explicitly enabled.

Parameters

  ecs | The proxy object

See also
  ecore_con_socks_apply_always()

Since
  1.2

## ◆ ecore_con_socks_apply_always()

EAPI void ecore_con_socks_apply_always | ( | Ecore_Con_Socks * | ecs | ) |

Set a proxy object to be used with all servers created with ecore_con_server_connect()

This function sets a proxy for all ecore_con connections. It will always be used.

Parameters

  ecs | The proxy object

See also
  ecore_con_socks_apply_once()

Since
  1.2

Note
  ecore-con supports setting this through environment variables like so: ECORE_CON_SOCKS_V4=[user@]server-port:lookup ECORE_CON_SOCKS_V5=[user@]server-port:lookup user is the OPTIONAL string that would be passed to the proxy as the username server is the IP_ADDRESS of the proxy server port is the port to connect to on the proxy server lookup is 1 if the proxy should perform all DNS lookups, otherwise 0 or omitted