Ben Schwartz ae4edfbf3e Implement optional support for SOCKS5-UDP
This change adds a new option, --socks5-udp.  If this option is
present, and no UDP gateway is specified, UDP packets will no
longer be dropped.  Instead, the client will use the SOCKS5
UDP ASSOCIATE command to route UDP packets through the proxy
server.

This implementation is intended for use with any UDP data, and it
includes an optimization for packets containing DNS queries.
However, this implementation is currently limited to localhost
SOCKS5 servers. SOCKS5-UDP does not perform well over actual
network links, as it requires several roundtrips to the server and
is not compatible with NAT.

This implementation is currently in use in a fork of tun2socks used
by Outline (https://getoutline.org) and Intra (https://getintra.org).

Fixes https://github.com/ambrop72/badvpn/issues/56
2020-02-01 15:02:11 -08:00
..
bison_BPredicate.c Regenerate Bison parser to fix build on MSVC. 2013-08-30 16:36:32 +00:00
bison_BPredicate.h Regenerate Bison parser to fix build on MSVC. 2013-08-30 16:36:32 +00:00
blog_channel_addr.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_BArpProbe.h add arpprobe 2011-09-28 23:54:44 +00:00
blog_channel_BConnection.h Replace BSocket with BConnection and BDatagram. On Windows, do all I/O through IOCP. 2011-05-28 14:07:05 +00:00
blog_channel_BDatagram.h Replace BSocket with BConnection and BDatagram. On Windows, do all I/O through IOCP. 2011-05-28 14:07:05 +00:00
blog_channel_BDHCPClient.h fix typo HDCP->DHCP 2010-12-09 01:35:01 +00:00
blog_channel_BDHCPClientCore.h fix typo HDCP->DHCP 2010-12-09 01:35:01 +00:00
blog_channel_BEncryption.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_BInputProcess.h add BInputProcess 2011-04-16 20:54:36 +00:00
blog_channel_BLockReactor.h system: add BThreadSignal and BLockReactor 2013-03-01 19:18:56 +00:00
blog_channel_BNetwork.h Replace BSocket with BConnection and BDatagram. On Windows, do all I/O through IOCP. 2011-05-28 14:07:05 +00:00
blog_channel_BPredicate.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_BProcess.h add BProcess 2010-12-17 16:28:05 +00:00
blog_channel_BReactor.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_BSignal.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_BSocksClient.h Add BSocksClient, a simple SOCKS5 client. Regenerate generated sources. 2010-11-27 11:25:09 +00:00
blog_channel_BSSLConnection.h Replace BSocket with BConnection and BDatagram. On Windows, do all I/O through IOCP. 2011-05-28 14:07:05 +00:00
blog_channel_BTap.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_BThreadSignal.h system: add BThreadSignal and BLockReactor 2013-03-01 19:18:56 +00:00
blog_channel_BThreadWork.h add BThreadWork 2011-03-13 23:35:29 +00:00
blog_channel_BTime.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_BUnixSignal.h add BUnixSignal 2010-12-17 16:24:36 +00:00
blog_channel_client.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_DatagramPeerIO.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_DataProto.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_dostest_attacker.h add some programs for playing with DoS attacks on TCP 2012-09-03 22:51:24 +00:00
blog_channel_dostest_server.h add some programs for playing with DoS attacks on TCP 2012-09-03 22:51:24 +00:00
blog_channel_DPReceive.h PacketPassInterface: remove Cancel in favour of RequestCancel with non-immediate effect, update 2011-03-21 00:01:41 +00:00
blog_channel_DPRelay.h client: implement relaying with DPRelay which makes use of DataProtoDevice 2011-01-23 13:58:28 +00:00
blog_channel_flooder.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_FragmentProtoAssembler.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_FrameDecider.h client: move deciding which peers frames are sent to into FrameDecider 2010-11-13 16:24:00 +00:00
blog_channel_LineBuffer.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_Listener.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_lwip.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_ncd_alias.h ncd: modules: add alias 2011-09-20 14:06:47 +00:00
blog_channel_ncd_arithmetic.h ncd: modules: add arithmetic 2012-03-26 20:21:40 +00:00
blog_channel_ncd_assert.h ncd: modules: add assert 2012-06-10 15:26:14 +00:00
blog_channel_ncd_backtrack.h ncd: modules: add backtrack 2012-11-01 01:35:00 +00:00
blog_channel_ncd_basic_functions.h ncd: Implement logging by function implementations. 2014-11-08 20:31:52 +01:00
blog_channel_ncd_blocker.h ncd: add blocker module 2011-04-03 21:13:14 +00:00
blog_channel_ncd_buffer.h ncd: modules: add buffer 2013-01-19 19:58:52 +00:00
blog_channel_ncd_call2.h ncd: modules: add call2 2012-05-26 14:33:07 +00:00
blog_channel_ncd_choose.h ncd: modules: add choose() 2011-10-01 20:33:11 +00:00
blog_channel_ncd_concat.h ncd: add concat module 2010-12-24 01:06:16 +00:00
blog_channel_ncd_daemon.h ncd: modules: add daemon 2012-01-25 17:19:10 +00:00
blog_channel_ncd_depend_scope.h ncd: modules: add depend_scope (like multidepend but with separate dependency scopes) 2012-11-13 18:56:08 +00:00
blog_channel_ncd_depend.h ncd: add dependencies module 2010-12-23 21:31:14 +00:00
blog_channel_ncd_dynamic_depend.h ncd: modules: add dynamic_depend 2011-12-18 21:43:06 +00:00
blog_channel_ncd_exit.h ncd: modules: add exit() and getargs(), making use of the new interface 2012-03-26 00:45:05 +00:00
blog_channel_ncd_explode.h ncd: modules: add explode 2012-07-05 23:51:03 +00:00
blog_channel_ncd_file_open.h ncd: modules: add file_open 2012-11-01 00:22:00 +00:00
blog_channel_ncd_file.h ncd: modules: add file 2012-04-29 11:14:06 +00:00
blog_channel_ncd_foreach.h ncd: modules: add foreach() 2011-10-01 19:12:14 +00:00
blog_channel_ncd_from_string.h ncd: modules: add from_string and to_string 2012-02-22 21:34:46 +00:00
blog_channel_ncd_getargs.h ncd: modules: add exit() and getargs(), making use of the new interface 2012-03-26 00:45:05 +00:00
blog_channel_ncd_getenv.h ncd: modules: add getenv 2013-01-26 00:19:16 +00:00
blog_channel_ncd_if.h ncd: add if module 2011-01-10 00:02:15 +00:00
blog_channel_ncd_imperative.h ncd: modules: add imperative 2011-12-19 13:39:53 +00:00
blog_channel_ncd_implode.h ncd: modules: add implode 2012-04-29 19:16:02 +00:00
blog_channel_ncd_index.h ncd: modules: add index 2011-09-17 18:18:07 +00:00
blog_channel_ncd_list.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd_load_module.h ncd: add load_module() 2013-03-13 14:53:15 +00:00
blog_channel_ncd_log_msg.h ncd: modules: add log 2012-12-12 19:29:45 +00:00
blog_channel_ncd_log.h ncd: modules: add log 2012-12-12 19:29:45 +00:00
blog_channel_ncd_logical.h ncd: add module for logical operators 2011-02-07 19:29:20 +00:00
blog_channel_ncd_multidepend.h ncd: add multidepend module 2011-03-27 12:30:54 +00:00
blog_channel_ncd_net_backend_badvpn.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd_net_backend_rfkill.h ncd: add net.backend.rfkill module 2011-03-27 08:06:11 +00:00
blog_channel_ncd_net_backend_waitdevice.h ncd: add net.backend.waitdevice module 2011-03-27 07:59:09 +00:00
blog_channel_ncd_net_backend_waitlink.h ncd: Fix NCDModule to signal module->NCD events directly instead of via jobs. Fixes possible 2011-03-31 21:39:59 +00:00
blog_channel_ncd_net_backend_wpa_supplicant.h ncd: add net.backend.wpa_supplicant module 2011-03-27 08:58:47 +00:00
blog_channel_ncd_net_dns.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd_net_iptables.h ncd: add iptables module 2010-12-24 22:54:05 +00:00
blog_channel_ncd_net_ipv4_addr_in_network.h ncd: modules: add net_ipv4_addr_in_network and net_ipv6_addr_in_network 2012-08-30 11:27:56 +00:00
blog_channel_ncd_net_ipv4_addr.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd_net_ipv4_arp_probe.h ncd: modules: add net.ipv4.arp_probe() 2011-09-29 00:03:39 +00:00
blog_channel_ncd_net_ipv4_dhcp.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd_net_ipv4_route.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd_net_ipv6_addr_in_network.h ncd: modules: add net_ipv4_addr_in_network and net_ipv6_addr_in_network 2012-08-30 11:27:56 +00:00
blog_channel_ncd_net_ipv6_addr.h ncd: modules: add net.ipv6.addr() 2012-08-27 01:33:54 +00:00
blog_channel_ncd_net_ipv6_route.h ncd: modules: add net.ipv6.route() 2012-08-27 02:13:07 +00:00
blog_channel_ncd_net_ipv6_wait_dynamic_addr.h ncd: modules: add net_ipv6_wait_dynamic_addr 2012-03-16 15:15:50 +00:00
blog_channel_ncd_net_up.h ncd: Fix NCDModule to signal module->NCD events directly instead of via jobs. Fixes possible 2011-03-31 21:39:59 +00:00
blog_channel_ncd_net_watch_interfaces.h ncd: add net.watch_interfaces module 2011-04-13 08:31:56 +00:00
blog_channel_ncd_netmask.h ncd: modules: add netmask 2012-04-29 18:36:43 +00:00
blog_channel_ncd_objref.h ncd: Implement object reference infrastructure and objref module. 2014-11-21 22:58:58 +01:00
blog_channel_ncd_ondemand.h ncd: modules: add ondemand 2011-09-27 00:10:44 +00:00
blog_channel_ncd_parse.h ncd: modules: add parse 2012-03-27 12:00:14 +00:00
blog_channel_ncd_print.h ncd: add print module 2011-04-02 21:34:41 +00:00
blog_channel_ncd_process_manager.h ncd: add process_manager module 2011-04-11 18:40:02 +00:00
blog_channel_ncd_reboot.h ncd: modules: add reboot 2012-07-05 23:48:27 +00:00
blog_channel_ncd_ref.h ncd: modules: add ref 2011-09-15 15:04:35 +00:00
blog_channel_ncd_regex_match.h ncd: add regex_match module 2011-04-11 23:02:16 +00:00
blog_channel_ncd_request.h ncd: improve requestproto such that it is possible for a client to abort a request. Reimplement request client 2012-03-25 00:05:47 +00:00
blog_channel_ncd_run.h ncd: add run module 2011-01-16 13:55:29 +00:00
blog_channel_ncd_runonce.h ncd: modules: add runonce 2011-06-18 13:19:05 +00:00
blog_channel_ncd_sleep.h ncd: Fix NCDModule to signal module->NCD events directly instead of via jobs. Fixes possible 2011-03-31 21:39:59 +00:00
blog_channel_ncd_socket.h ncd: modules: add socket 2012-11-04 15:31:10 +00:00
blog_channel_ncd_spawn.h ncd: modules: synchronous_process: rename to spawn 2011-09-15 15:26:34 +00:00
blog_channel_ncd_strcmp.h ncd: add strcmp module 2011-01-10 00:04:49 +00:00
blog_channel_ncd_substr.h ncd: modules: add substr 2012-11-18 01:11:43 +00:00
blog_channel_ncd_sys_evdev.h ncd: add sys.evdev module 2011-04-03 11:16:50 +00:00
blog_channel_ncd_sys_request_client.h ncd: modules: add sys.request_client 2012-03-25 22:03:39 +00:00
blog_channel_ncd_sys_request_server.h ncd: modules: add sys_request_server. Also add ncd-request tool. 2012-03-10 01:27:55 +00:00
blog_channel_ncd_sys_start_process.h ncd: modules: add sys.start_process() 2012-12-01 02:52:15 +00:00
blog_channel_ncd_sys_watch_directory.h ncd :add sys.watch_directory module 2011-04-12 11:53:24 +00:00
blog_channel_ncd_sys_watch_input.h ncd: modules: add sys.watch_input 2011-06-23 13:45:35 +00:00
blog_channel_ncd_sys_watch_usb.h ncd: modules: add sys.watch_usb() 2011-10-31 08:57:21 +00:00
blog_channel_ncd_timer.h ncd: modules: add periodic_timer() 2012-10-29 23:57:45 +00:00
blog_channel_ncd_to_string.h ncd: modules: add from_string and to_string 2012-02-22 21:34:46 +00:00
blog_channel_ncd_try.h ncd: modules: add try 2012-03-09 15:52:38 +00:00
blog_channel_ncd_value.h ncd: modules: add value 2012-02-23 12:49:30 +00:00
blog_channel_ncd_valuemetic.h ncd: modules: add valuemetic 2012-04-20 19:34:25 +00:00
blog_channel_ncd_var.h ncd: major rework, make NCD into a much more general system 2010-12-23 13:45:59 +00:00
blog_channel_ncd.h Add NCD, the Network Configuration Daemon 2010-12-10 00:21:40 +00:00
blog_channel_NCDBuildProgram.h ncd: implement NCDBuildProgram and make ncd.c utilize it. This finishes the initial implementation of the include system. 2012-12-04 18:25:43 +00:00
blog_channel_NCDConfigParser.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_NCDConfigTokenizer.h ncd: NCDConfigTokenizer: remove the 128 characters limit on strings 2011-10-02 17:46:08 +00:00
blog_channel_NCDIfConfig.h Add NCD, the Network Configuration Daemon 2010-12-10 00:21:40 +00:00
blog_channel_NCDInterfaceMonitor.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_NCDModuleIndex.h ncd: add NCDModuleIndex to find modules faster 2011-10-05 15:14:55 +00:00
blog_channel_NCDModuleProcess.h ncd: rework object/variable resolution. Rather than working with string object expressions, work with individual 2012-02-18 00:52:06 +00:00
blog_channel_NCDPlaceholderDb.h ncd: improve how arguments are instantiated. Keep the incomplete arguments in NCDValMem's, but containing placholder values in place 2012-08-03 00:19:59 +00:00
blog_channel_NCDRequest.h ncd: modules: add sys_request_server. Also add ncd-request tool. 2012-03-10 01:27:55 +00:00
blog_channel_NCDRequestClient.h ncd: improve requestproto such that it is possible for a client to abort a request. Reimplement request client 2012-03-25 00:05:47 +00:00
blog_channel_NCDRfkillMonitor.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_NCDUdevCache.h add udevmonitor subsystem 2011-04-26 00:11:43 +00:00
blog_channel_NCDUdevManager.h add udevmonitor subsystem 2011-04-26 00:11:43 +00:00
blog_channel_NCDUdevMonitor.h add udevmonitor subsystem 2011-04-26 00:11:43 +00:00
blog_channel_NCDUdevMonitorParser.h add udevmonitor subsystem 2011-04-26 00:11:43 +00:00
blog_channel_NCDVal.h ncd: improve how arguments are instantiated. Keep the incomplete arguments in NCDValMem's, but containing placholder values in place 2012-08-03 00:19:59 +00:00
blog_channel_NCDValGenerator.h ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00
blog_channel_NCDValParser.h ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00
blog_channel_nsskey.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_PacketProtoDecoder.h don't log error details in error handlers 2011-01-22 09:38:19 +00:00
blog_channel_PasswordListener.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_PeerChat.h Make peers use SSL when talking through the server. 2011-07-13 20:08:59 +00:00
blog_channel_PRStreamSink.h log errors where they occur 2011-01-22 09:14:20 +00:00
blog_channel_PRStreamSource.h log errors where they occur 2011-01-22 09:14:20 +00:00
blog_channel_server.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_ServerConnection.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_SocksUdpClient.h Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
blog_channel_SocksUdpGwClient.h tun2socks: add SocksUdpGwClient 2011-05-07 18:30:57 +00:00
blog_channel_SPProtoDecoder.h use BLog instead od DEBUG 2011-04-27 23:58:34 +00:00
blog_channel_StreamPeerIO.h Initial import 2010-10-25 09:17:17 +00:00
blog_channel_tun2socks.h add tun2socks 2010-11-27 13:43:32 +00:00
blog_channel_udpgw.h add udpgw 2011-05-07 17:12:16 +00:00
blog_channel_UdpGwClient.h add udpgw_client 2011-05-07 18:25:07 +00:00
blog_channels_defines.h Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
blog_channels_list.h Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
bproto_addr.h bproto_generator: fix aliasing issues 2012-12-30 12:48:01 +00:00
bproto_bproto_test.h bproto_generator: fix aliasing issues 2012-12-30 12:48:01 +00:00
bproto_msgproto.h bproto_generator: fix aliasing issues 2012-12-30 12:48:01 +00:00
flex_BPredicate.c regenerate bison/flex stuff for BPredicate 2012-10-03 20:53:27 +00:00
flex_BPredicate.h regenerate bison/flex stuff for BPredicate 2012-10-03 20:53:27 +00:00
NCDConfigParser_parse.c ncd: Permit functions with have zero arguments. 2015-01-22 22:35:51 +01:00
NCDConfigParser_parse.h Implement Do-Interrupt. 2014-12-20 19:37:46 +01:00
NCDConfigParser_parse.out ncd: Permit functions with have zero arguments. 2015-01-22 22:35:51 +01:00
NCDConfigParser_parse.y ncd: Permit functions with have zero arguments. 2015-01-22 22:35:51 +01:00
NCDValParser_parse.c ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00
NCDValParser_parse.h ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00
NCDValParser_parse.out ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00
NCDValParser_parse.y ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00