1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright (C) 2008, 2010 Collabora, Ltd.
4 * Copyright (C) 2008 Nokia Corporation. All rights reserved.
6 * SPDX-License-Identifier: LGPL-2.1-or-later
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General
19 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 * Author: Youness Alaoui <youness.alaoui@collabora.co.uk
24 * Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
29 #include "gsocks5proxy.h"
33 #include "giomodule.h"
34 #include "giomodule-priv.h"
35 #include "giostream.h"
36 #include "ginetaddress.h"
37 #include "ginputstream.h"
39 #include "goutputstream.h"
41 #include "gproxyaddress.h"
44 #define SOCKS5_VERSION 0x05
46 #define SOCKS5_CMD_CONNECT 0x01
47 #define SOCKS5_CMD_BIND 0x02
48 #define SOCKS5_CMD_UDP_ASSOCIATE 0x03
50 #define SOCKS5_ATYP_IPV4 0x01
51 #define SOCKS5_ATYP_DOMAINNAME 0x03
52 #define SOCKS5_ATYP_IPV6 0x04
54 #define SOCKS5_AUTH_VERSION 0x01
56 #define SOCKS5_AUTH_NONE 0x00
57 #define SOCKS5_AUTH_GSSAPI 0x01
58 #define SOCKS5_AUTH_USR_PASS 0x02
59 #define SOCKS5_AUTH_NO_ACCEPT 0xff
61 #define SOCKS5_MAX_LEN 255
62 #define SOCKS5_RESERVED 0x00
64 #define SOCKS5_REP_SUCCEEDED 0x00
65 #define SOCKS5_REP_SRV_FAILURE 0x01
66 #define SOCKS5_REP_NOT_ALLOWED 0x02
67 #define SOCKS5_REP_NET_UNREACH 0x03
68 #define SOCKS5_REP_HOST_UNREACH 0x04
69 #define SOCKS5_REP_REFUSED 0x05
70 #define SOCKS5_REP_TTL_EXPIRED 0x06
71 #define SOCKS5_REP_CMD_NOT_SUP 0x07
72 #define SOCKS5_REP_ATYPE_NOT_SUP 0x08
80 struct _GSocks5ProxyClass
82 GObjectClass parent_class;
85 static void g_socks5_proxy_iface_init (GProxyInterface *proxy_iface);
87 #define g_socks5_proxy_get_type _g_socks5_proxy_get_type
88 G_DEFINE_TYPE_WITH_CODE (GSocks5Proxy, g_socks5_proxy, G_TYPE_OBJECT,
89 G_IMPLEMENT_INTERFACE (G_TYPE_PROXY,
90 g_socks5_proxy_iface_init)
91 _g_io_modules_ensure_extension_points_registered ();
92 g_io_extension_point_implement (G_PROXY_EXTENSION_POINT_NAME,
98 g_socks5_proxy_finalize (GObject *object)
101 G_OBJECT_CLASS (g_socks5_proxy_parent_class)->finalize (object);
105 g_socks5_proxy_init (GSocks5Proxy *proxy)
110 * +----+----------+----------+
111 * |VER | NMETHODS | METHODS |
112 * +----+----------+----------+
113 * | 1 | 1 | 1 to 255 |
114 * +----+----------+----------+
116 #define SOCKS5_NEGO_MSG_LEN 4
118 set_nego_msg (guint8 *msg, gboolean has_auth)
122 msg[0] = SOCKS5_VERSION;
123 msg[1] = 0x01; /* number of methods supported */
124 msg[2] = SOCKS5_AUTH_NONE;
126 /* add support for authentication method */
129 msg[1] = 0x02; /* number of methods supported */
130 msg[3] = SOCKS5_AUTH_USR_PASS;
145 #define SOCKS5_NEGO_REP_LEN 2
147 parse_nego_reply (const guint8 *data,
152 if (data[0] != SOCKS5_VERSION)
154 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
155 _("The server is not a SOCKSv5 proxy server."));
161 case SOCKS5_AUTH_NONE:
165 case SOCKS5_AUTH_USR_PASS:
168 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_NEED_AUTH,
169 _("The SOCKSv5 proxy requires authentication."));
175 case SOCKS5_AUTH_NO_ACCEPT:
178 /* The server has said it accepts none of our authentication methods,
179 * but given the slightly odd implementation of set_nego_msg(), we
180 * actually only gave it the choice of %SOCKS5_AUTH_NONE, since the
181 * caller specified no username or password.
182 * Return %G_IO_ERROR_PROXY_NEED_AUTH so the caller knows that if
183 * they specify a username and password and try again, authentication
184 * might succeed (since we’ll send %SOCKS5_AUTH_USR_PASS next time). */
185 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_NEED_AUTH,
186 _("The SOCKSv5 proxy requires authentication."));
190 case SOCKS5_AUTH_GSSAPI:
192 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED,
193 _("The SOCKSv5 proxy requires an authentication "
194 "method that is not supported by GLib."));
202 #define SOCKS5_AUTH_MSG_LEN 515
204 set_auth_msg (guint8 *msg,
205 const gchar *username,
206 const gchar *password,
210 gint ulen = 0; /* username length */
211 gint plen = 0; /* Password length */
214 ulen = strlen (username);
217 plen = strlen (password);
219 if (ulen > SOCKS5_MAX_LEN || plen > SOCKS5_MAX_LEN)
221 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
222 _("Username or password is too long for SOCKSv5 "
227 msg[len++] = SOCKS5_AUTH_VERSION;
231 memcpy (msg + len, username, ulen);
237 memcpy (msg + len, password, plen);
246 check_auth_status (const guint8 *data, GError **error)
248 if (data[0] != SOCKS5_AUTH_VERSION
249 || data[1] != SOCKS5_REP_SUCCEEDED)
251 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED,
252 _("SOCKSv5 authentication failed due to wrong "
253 "username or password."));
260 * +----+-----+-------+------+----------+----------+
261 * |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |
262 * +----+-----+-------+------+----------+----------+
263 * | 1 | 1 | X'00' | 1 | Variable | 2 |
264 * +----+-----+-------+------+----------+----------+
265 * DST.ADDR is a string with first byte being the size. So DST.ADDR may not be
266 * longer then 256 bytes.
268 #define SOCKS5_CONN_MSG_LEN 262
270 set_connect_msg (guint8 *msg,
271 const gchar *hostname,
277 msg[len++] = SOCKS5_VERSION;
278 msg[len++] = SOCKS5_CMD_CONNECT;
279 msg[len++] = SOCKS5_RESERVED;
281 if (g_hostname_is_ip_address (hostname))
283 GInetAddress *addr = g_inet_address_new_from_string (hostname);
284 gsize addr_len = g_inet_address_get_native_size (addr);
286 /* We are cheating for simplicity, here's the logic:
287 * 1 = IPV4 = 4 bytes / 4
288 * 4 = IPV6 = 16 bytes / 4 */
289 msg[len++] = addr_len / 4;
290 memcpy (msg + len, g_inet_address_to_bytes (addr), addr_len);
293 g_object_unref (addr);
297 gsize host_len = strlen (hostname);
299 if (host_len > SOCKS5_MAX_LEN)
301 g_set_error (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
302 _("Hostname “%s” is too long for SOCKSv5 protocol"),
307 msg[len++] = SOCKS5_ATYP_DOMAINNAME;
308 msg[len++] = (guint8) host_len;
309 memcpy (msg + len, hostname, host_len);
314 guint16 hp = g_htons (port);
315 memcpy (msg + len, &hp, 2);
323 * +----+-----+-------+------+----------+----------+
324 * |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT |
325 * +----+-----+-------+------+----------+----------+
326 * | 1 | 1 | X'00' | 1 | Variable | 2 |
327 * +----+-----+-------+------+----------+----------+
328 * This reply need to be read by small part to determine size. Buffer
329 * size is determined in function of the biggest part to read.
331 * The parser only requires 4 bytes.
333 #define SOCKS5_CONN_REP_LEN 257
335 parse_connect_reply (const guint8 *data, gint *atype, GError **error)
337 if (data[0] != SOCKS5_VERSION)
339 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
340 _("The server is not a SOCKSv5 proxy server."));
346 case SOCKS5_REP_SUCCEEDED:
347 if (data[2] != SOCKS5_RESERVED)
349 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
350 _("The server is not a SOCKSv5 proxy server."));
356 case SOCKS5_ATYP_IPV4:
357 case SOCKS5_ATYP_IPV6:
358 case SOCKS5_ATYP_DOMAINNAME:
363 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
364 _("The SOCKSv5 proxy server uses unknown address type."));
369 case SOCKS5_REP_SRV_FAILURE:
370 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
371 _("Internal SOCKSv5 proxy server error."));
375 case SOCKS5_REP_NOT_ALLOWED:
376 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_NOT_ALLOWED,
377 _("SOCKSv5 connection not allowed by ruleset."));
381 case SOCKS5_REP_TTL_EXPIRED:
382 case SOCKS5_REP_HOST_UNREACH:
383 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE,
384 _("Host unreachable through SOCKSv5 server."));
388 case SOCKS5_REP_NET_UNREACH:
389 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE,
390 _("Network unreachable through SOCKSv5 proxy."));
394 case SOCKS5_REP_REFUSED:
395 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED,
396 _("Connection refused through SOCKSv5 proxy."));
400 case SOCKS5_REP_CMD_NOT_SUP:
401 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
402 _("SOCKSv5 proxy does not support “connect” command."));
406 case SOCKS5_REP_ATYPE_NOT_SUP:
407 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
408 _("SOCKSv5 proxy does not support provided address type."));
412 default: /* Unknown error */
413 g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_FAILED,
414 _("Unknown SOCKSv5 proxy error."));
423 g_socks5_proxy_connect (GProxy *proxy,
424 GIOStream *io_stream,
425 GProxyAddress *proxy_address,
426 GCancellable *cancellable,
432 const gchar *hostname;
434 const gchar *username;
435 const gchar *password;
437 hostname = g_proxy_address_get_destination_hostname (proxy_address);
438 port = g_proxy_address_get_destination_port (proxy_address);
439 username = g_proxy_address_get_username (proxy_address);
440 password = g_proxy_address_get_password (proxy_address);
442 has_auth = username || password;
444 in = g_io_stream_get_input_stream (io_stream);
445 out = g_io_stream_get_output_stream (io_stream);
447 /* Send SOCKS5 handshake */
449 guint8 msg[SOCKS5_NEGO_MSG_LEN];
452 len = set_nego_msg (msg, has_auth);
454 if (!g_output_stream_write_all (out, msg, len, NULL,
459 /* Receive SOCKS5 response and reply with authentication if required */
461 guint8 data[SOCKS5_NEGO_REP_LEN];
462 gboolean must_auth = FALSE;
464 if (!g_input_stream_read_all (in, data, sizeof (data), NULL,
468 if (!parse_nego_reply (data, has_auth, &must_auth, error))
473 guint8 msg[SOCKS5_AUTH_MSG_LEN];
476 len = set_auth_msg (msg, username, password, error);
481 if (!g_output_stream_write_all (out, msg, len, NULL,
485 if (!g_input_stream_read_all (in, data, sizeof (data), NULL,
489 if (!check_auth_status (data, error))
494 /* Send SOCKS5 connection request */
496 guint8 msg[SOCKS5_CONN_MSG_LEN];
499 len = set_connect_msg (msg, hostname, port, error);
504 if (!g_output_stream_write_all (out, msg, len, NULL,
509 /* Read SOCKS5 response */
511 guint8 data[SOCKS5_CONN_REP_LEN];
514 if (!g_input_stream_read_all (in, data, 4 /* VER, REP, RSV, ATYP */, NULL,
518 if (!parse_connect_reply (data, &atype, error))
523 case SOCKS5_ATYP_IPV4:
524 if (!g_input_stream_read_all (in, data,
525 4 /* IPv4 length */ + 2 /* port */,
526 NULL, cancellable, error))
530 case SOCKS5_ATYP_IPV6:
531 if (!g_input_stream_read_all (in, data,
532 16 /* IPv6 length */ + 2 /* port */,
533 NULL, cancellable, error))
537 case SOCKS5_ATYP_DOMAINNAME:
538 if (!g_input_stream_read_all (in, data, 1 /* domain name length */,
539 NULL, cancellable, error))
541 if (!g_input_stream_read_all (in, data,
542 data[0] /* domain name length */ + 2 /* port */,
543 NULL, cancellable, error))
549 return g_object_ref (io_stream);
558 GIOStream *io_stream;
568 static void nego_msg_write_cb (GObject *source,
571 static void nego_reply_read_cb (GObject *source,
574 static void auth_msg_write_cb (GObject *source,
577 static void auth_reply_read_cb (GObject *source,
578 GAsyncResult *result,
580 static void send_connect_msg (GTask *task);
581 static void connect_msg_write_cb (GObject *source,
582 GAsyncResult *result,
584 static void connect_reply_read_cb (GObject *source,
585 GAsyncResult *result,
587 static void connect_addr_len_read_cb (GObject *source,
588 GAsyncResult *result,
590 static void connect_addr_read_cb (GObject *source,
591 GAsyncResult *result,
595 free_connect_data (ConnectAsyncData *data)
597 g_object_unref (data->io_stream);
599 g_free (data->hostname);
600 g_free (data->username);
601 g_free (data->password);
602 g_free (data->buffer);
604 g_slice_free (ConnectAsyncData, data);
608 do_read (GAsyncReadyCallback callback, GTask *task, ConnectAsyncData *data)
611 in = g_io_stream_get_input_stream (data->io_stream);
612 g_input_stream_read_async (in,
613 data->buffer + data->offset,
614 data->length - data->offset,
615 g_task_get_priority (task),
616 g_task_get_cancellable (task),
621 do_write (GAsyncReadyCallback callback, GTask *task, ConnectAsyncData *data)
624 out = g_io_stream_get_output_stream (data->io_stream);
625 g_output_stream_write_async (out,
626 data->buffer + data->offset,
627 data->length - data->offset,
628 g_task_get_priority (task),
629 g_task_get_cancellable (task),
634 g_socks5_proxy_connect_async (GProxy *proxy,
635 GIOStream *io_stream,
636 GProxyAddress *proxy_address,
637 GCancellable *cancellable,
638 GAsyncReadyCallback callback,
642 ConnectAsyncData *data;
644 data = g_slice_new0 (ConnectAsyncData);
645 data->io_stream = g_object_ref (io_stream);
647 task = g_task_new (proxy, cancellable, callback, user_data);
648 g_task_set_source_tag (task, g_socks5_proxy_connect_async);
649 g_task_set_task_data (task, data, (GDestroyNotify) free_connect_data);
651 g_object_get (G_OBJECT (proxy_address),
652 "destination-hostname", &data->hostname,
653 "destination-port", &data->port,
654 "username", &data->username,
655 "password", &data->password,
658 data->buffer = g_malloc0 (SOCKS5_NEGO_MSG_LEN);
659 data->length = set_nego_msg (data->buffer,
660 data->username || data->password);
663 do_write (nego_msg_write_cb, task, data);
668 nego_msg_write_cb (GObject *source,
672 GTask *task = user_data;
673 ConnectAsyncData *data = g_task_get_task_data (task);
674 GError *error = NULL;
677 written = g_output_stream_write_finish (G_OUTPUT_STREAM (source),
682 g_task_return_error (task, error);
683 g_object_unref (task);
687 data->offset += written;
689 if (data->offset == data->length)
691 g_free (data->buffer);
693 data->buffer = g_malloc0 (SOCKS5_NEGO_REP_LEN);
694 data->length = SOCKS5_NEGO_REP_LEN;
697 do_read (nego_reply_read_cb, task, data);
701 do_write (nego_msg_write_cb, task, data);
706 nego_reply_read_cb (GObject *source,
710 GTask *task = user_data;
711 ConnectAsyncData *data = g_task_get_task_data (task);
712 GError *error = NULL;
715 read = g_input_stream_read_finish (G_INPUT_STREAM (source),
720 g_task_return_error (task, error);
721 g_object_unref (task);
727 g_task_return_new_error (task,
729 G_IO_ERROR_CONNECTION_CLOSED,
730 "Connection to SOCKSv5 proxy server lost");
731 g_object_unref (task);
735 data->offset += read;
737 if (data->offset == data->length)
739 gboolean must_auth = FALSE;
740 gboolean has_auth = data->username || data->password;
742 if (!parse_nego_reply (data->buffer, has_auth, &must_auth, &error))
744 g_task_return_error (task, error);
745 g_object_unref (task);
751 g_free (data->buffer);
753 data->buffer = g_malloc0 (SOCKS5_AUTH_MSG_LEN);
754 data->length = set_auth_msg (data->buffer,
760 if (data->length < 0)
762 g_task_return_error (task, error);
763 g_object_unref (task);
767 do_write (auth_msg_write_cb, task, data);
771 send_connect_msg (task);
776 do_read (nego_reply_read_cb, task, data);
781 auth_msg_write_cb (GObject *source,
782 GAsyncResult *result,
785 GTask *task = user_data;
786 ConnectAsyncData *data = g_task_get_task_data (task);
787 GError *error = NULL;
790 written = g_output_stream_write_finish (G_OUTPUT_STREAM (source),
795 g_task_return_error (task, error);
796 g_object_unref (task);
800 data->offset += written;
802 if (data->offset == data->length)
804 g_free (data->buffer);
806 data->buffer = g_malloc0 (SOCKS5_NEGO_REP_LEN);
807 data->length = SOCKS5_NEGO_REP_LEN;
810 do_read (auth_reply_read_cb, task, data);
814 do_write (auth_msg_write_cb, task, data);
819 auth_reply_read_cb (GObject *source,
820 GAsyncResult *result,
823 GTask *task = user_data;
824 ConnectAsyncData *data = g_task_get_task_data (task);
825 GError *error = NULL;
828 read = g_input_stream_read_finish (G_INPUT_STREAM (source),
833 g_task_return_error (task, error);
834 g_object_unref (task);
840 g_task_return_new_error (task,
842 G_IO_ERROR_CONNECTION_CLOSED,
843 "Connection to SOCKSv5 proxy server lost");
844 g_object_unref (task);
848 data->offset += read;
850 if (data->offset == data->length)
852 if (!check_auth_status (data->buffer, &error))
854 g_task_return_error (task, error);
855 g_object_unref (task);
859 send_connect_msg (task);
863 do_read (auth_reply_read_cb, task, data);
868 send_connect_msg (GTask *task)
870 ConnectAsyncData *data = g_task_get_task_data (task);
871 GError *error = NULL;
873 g_free (data->buffer);
875 data->buffer = g_malloc0 (SOCKS5_CONN_MSG_LEN);
876 data->length = set_connect_msg (data->buffer,
882 if (data->length < 0)
884 g_task_return_error (task, error);
885 g_object_unref (task);
889 do_write (connect_msg_write_cb, task, data);
893 connect_msg_write_cb (GObject *source,
894 GAsyncResult *result,
897 GTask *task = user_data;
898 ConnectAsyncData *data = g_task_get_task_data (task);
899 GError *error = NULL;
902 written = g_output_stream_write_finish (G_OUTPUT_STREAM (source),
907 g_task_return_error (task, error);
908 g_object_unref (task);
912 data->offset += written;
914 if (data->offset == data->length)
916 g_free (data->buffer);
918 data->buffer = g_malloc0 (SOCKS5_CONN_REP_LEN);
922 do_read (connect_reply_read_cb, task, data);
926 do_write (connect_msg_write_cb, task, data);
931 connect_reply_read_cb (GObject *source,
932 GAsyncResult *result,
935 GTask *task = user_data;
936 ConnectAsyncData *data = g_task_get_task_data (task);
937 GError *error = NULL;
940 read = g_input_stream_read_finish (G_INPUT_STREAM (source),
945 g_task_return_error (task, error);
946 g_object_unref (task);
952 g_task_return_new_error (task,
954 G_IO_ERROR_CONNECTION_CLOSED,
955 "Connection to SOCKSv5 proxy server lost");
956 g_object_unref (task);
960 data->offset += read;
962 if (data->offset == data->length)
966 if (!parse_connect_reply (data->buffer, &atype, &error))
968 g_task_return_error (task, error);
969 g_object_unref (task);
975 case SOCKS5_ATYP_IPV4:
978 do_read (connect_addr_read_cb, task, data);
981 case SOCKS5_ATYP_IPV6:
984 do_read (connect_addr_read_cb, task, data);
987 case SOCKS5_ATYP_DOMAINNAME:
990 do_read (connect_addr_len_read_cb, task, data);
996 do_read (connect_reply_read_cb, task, data);
1001 connect_addr_len_read_cb (GObject *source,
1002 GAsyncResult *result,
1005 GTask *task = user_data;
1006 ConnectAsyncData *data = g_task_get_task_data (task);
1007 GError *error = NULL;
1010 read = g_input_stream_read_finish (G_INPUT_STREAM (source),
1015 g_task_return_error (task, error);
1016 g_object_unref (task);
1022 g_task_return_new_error (task,
1024 G_IO_ERROR_CONNECTION_CLOSED,
1025 "Connection to SOCKSv5 proxy server lost");
1026 g_object_unref (task);
1030 data->length = data->buffer[0] + 2;
1033 do_read (connect_addr_read_cb, task, data);
1037 connect_addr_read_cb (GObject *source,
1038 GAsyncResult *result,
1041 GTask *task = user_data;
1042 ConnectAsyncData *data = g_task_get_task_data (task);
1043 GError *error = NULL;
1046 read = g_input_stream_read_finish (G_INPUT_STREAM (source),
1051 g_task_return_error (task, error);
1052 g_object_unref (task);
1058 g_task_return_new_error (task,
1060 G_IO_ERROR_CONNECTION_CLOSED,
1061 "Connection to SOCKSv5 proxy server lost");
1062 g_object_unref (task);
1066 data->offset += read;
1068 if (data->offset == data->length)
1070 g_task_return_pointer (task, g_object_ref (data->io_stream), g_object_unref);
1071 g_object_unref (task);
1076 do_read (connect_reply_read_cb, task, data);
1081 g_socks5_proxy_connect_finish (GProxy *proxy,
1082 GAsyncResult *result,
1085 return g_task_propagate_pointer (G_TASK (result), error);
1089 g_socks5_proxy_supports_hostname (GProxy *proxy)
1095 g_socks5_proxy_class_init (GSocks5ProxyClass *class)
1097 GObjectClass *object_class;
1099 object_class = (GObjectClass *) class;
1100 object_class->finalize = g_socks5_proxy_finalize;
1104 g_socks5_proxy_iface_init (GProxyInterface *proxy_iface)
1106 proxy_iface->connect = g_socks5_proxy_connect;
1107 proxy_iface->connect_async = g_socks5_proxy_connect_async;
1108 proxy_iface->connect_finish = g_socks5_proxy_connect_finish;
1109 proxy_iface->supports_hostname = g_socks5_proxy_supports_hostname;