Skip to content

Commit

Permalink
Initial UDP over Socks5 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkk committed Dec 3, 2010
1 parent 2e35ae4 commit c0d4ced
Show file tree
Hide file tree
Showing 6 changed files with 827 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CFLAGS=-std=gnu99 -Wall -g -O0
.PHONY: all
all: redsocks

obj = parser.o main.o redsocks.o log.o http-connect.o socks4.o socks5.o http-relay.o base.o utils.o
obj = parser.o main.o redsocks.o log.o http-connect.o socks4.o socks5.o http-relay.o base.o utils.o redudp.o
src = $(patsubst %.o,%.c,$(obj))

redsocks: $(obj)
Expand Down
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Features
Redirect any TCP connection to SOCKS4, SOCKS5 or HTTPS (HTTP/CONNECT)
proxy server.

Redirect UDP packets via SOCKS5 proxy server.

Login/password authentication is supported for SOCKS5 connections.
SOCKS4 supports only username, password is ignored.

Expand Down
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

extern app_subsys redsocks_subsys;
extern app_subsys base_subsys;
// extern app_subsys reddns_subsys;
extern app_subsys redudp_subsys;

app_subsys *subsystems[] = {
&redsocks_subsys,
&base_subsys,
// &reddns_subsys,
&redudp_subsys,
};

static const char *confname = "redsocks.conf";
Expand Down
27 changes: 26 additions & 1 deletion redsocks.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,29 @@ redsocks {
// password = "baz";
}

// you can add one more `redsocks' section if you need.
redudp {
// `local_ip' should not be 0.0.0.0 as it's also used for outgoing
// packets that are sent as replies - and it should be fixed
// if we want NAT to work properly.
local_ip = 127.0.0.1;
local_port = 10053;

// `ip' and `port' of socks5 proxy server.
ip = 10.0.0.1;
port = 1080;
login = username;
password = pazzw0rd;

// kernel does not give us this information, so we have to duplicate it
// in both iptables rules and configuration file. By the way, you can
// set `local_ip' to 127.45.67.89 if you need more than 65535 ports to
// forward ;-)
// This limitation may be relaxed in future versions using contrack-tools.
dest_ip = 8.8.8.8;
dest_port = 53;

udp_timeout = 30;
udp_timeout_stream = 180;
}

// you can add more `redsocks' and `redudp' sections if you need.
Loading

0 comments on commit c0d4ced

Please sign in to comment.