0
0
mirror of https://github.com/darkk/redsocks.git synced 2025-08-26 19:55:30 +00:00

Added redsocks.local_ip setting

This commit is contained in:
darkk 2007-06-03 13:00:10 +00:00 committed by Leonid Evdokimov
parent 20d7930ecf
commit 5b46a9c5c8
2 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,7 @@ base {
} }
redsocks { redsocks {
local_ip = 127.0.0.1;
local_port = 12345; local_port = 12345;
ip = 127.0.0.1; ip = 127.0.0.1;
port = 3128; port = 3128;

View File

@ -58,6 +58,7 @@ static redsocks_instance instance =
static parser_entry redsocks_entries[] = static parser_entry redsocks_entries[] =
{ {
{ .key = "local_ip", .type = pt_uint16, .addr = &instance.config.bindaddr.sin_addr },
{ .key = "local_port", .type = pt_uint16, .addr = &instance.config.bindaddr.sin_port }, { .key = "local_port", .type = pt_uint16, .addr = &instance.config.bindaddr.sin_port },
{ .key = "ip", .type = pt_in_addr, .addr = &instance.config.relayaddr.sin_addr }, { .key = "ip", .type = pt_in_addr, .addr = &instance.config.relayaddr.sin_addr },
{ .key = "port", .type = pt_uint16, .addr = &instance.config.relayaddr.sin_port }, { .key = "port", .type = pt_uint16, .addr = &instance.config.relayaddr.sin_port },
@ -76,6 +77,7 @@ static int redsocks_onenter(parser_section *section)
instance.config.bindaddr.sin_family = AF_INET; instance.config.bindaddr.sin_family = AF_INET;
instance.config.bindaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); instance.config.bindaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
instance.config.relayaddr.sin_family = AF_INET; instance.config.relayaddr.sin_family = AF_INET;
instance.config.relayaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
return 0; return 0;
} }