Skip to content

Commit

Permalink
change udp_idle_sec to 60, change udp_ctx_maxcnt to 256
Browse files Browse the repository at this point in the history
  • Loading branch information
zfl9 committed May 16, 2020
1 parent 517b319 commit cfbc218
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ usage: ipt2socks <options...>. the existing options are as follows:
-B, --listen-addr6 <addr> listen ipv6 address, default: ::1
-l, --listen-port <port> listen port number, default: 60080
-S, --tcp-syncnt <cnt> change the number of tcp syn retransmits
-c, --cache-size <size> udp context cache maxsize, default: 128
-o, --udp-timeout <sec> udp context idle timeout, default: 30
-c, --cache-size <size> udp context cache maxsize, default: 256
-o, --udp-timeout <sec> udp context idle timeout, default: 60
-j, --thread-nums <num> number of the worker threads, default: 1
-n, --nofile-limit <num> set nofile limit, may need root privilege
-u, --run-user <user> run as the given user, need root privilege
Expand All @@ -61,8 +61,8 @@ usage: ipt2socks <options...>. the existing options are as follows:
- `-B`选项:本地 IPv6 监听地址,默认为 ::1。
- `-l`选项:本地 IPv4/6 监听端口,默认为 60080。
- `-S`选项:与 socks5 服务器建立 TCP 连接的超时参数。
- `-c`选项:UDP 上下文的最大数量,默认为 128 个。
- `-o`选项:UDP 上下文的超时时间,默认为 30 秒。
- `-c`选项:UDP 上下文的最大数量,默认为 256 个。
- `-o`选项:UDP 上下文的超时时间,默认为 60 秒。
- `-j`选项:需要启动的工作线程数量,默认为单个线程。
- `-n`选项:设置 ipt2socks 进程可打开的文件描述符限制。
- `-u`选项:即 run-as-user 功能,需要 root 权限才能生效。
Expand Down
6 changes: 3 additions & 3 deletions ipt2socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static skaddr6_t g_server_skaddr = {0};

static uint8_t g_tcp_syncnt_max = 0; // 0: use default syncnt

static uint16_t g_udp_idletimeout_sec = 30;
static uint16_t g_udp_idletimeout_sec = 60;
static udp_socks5ctx_t *g_udp_socks5ctx_table = NULL;
static udp_tproxyctx_t *g_udp_tproxyctx_table = NULL;
static char g_udp_dgram_buffer[UDP_DATAGRAM_MAXSIZ] = {0};
Expand All @@ -104,8 +104,8 @@ static void print_command_help(void) {
" -B, --listen-addr6 <addr> listen ipv6 address, default: ::1\n"
" -l, --listen-port <port> listen port number, default: 60080\n"
" -S, --tcp-syncnt <cnt> change the number of tcp syn retransmits\n"
" -c, --cache-size <size> udp context cache maxsize, default: 128\n"
" -o, --udp-timeout <sec> udp context idle timeout, default: 30\n"
" -c, --cache-size <size> udp context cache maxsize, default: 256\n"
" -o, --udp-timeout <sec> udp context idle timeout, default: 60\n"
" -j, --thread-nums <num> number of the worker threads, default: 1\n"
" -n, --nofile-limit <num> set nofile limit, may need root privilege\n"
" -u, --run-user <user> run as the given user, need root privilege\n"
Expand Down
2 changes: 1 addition & 1 deletion lrucache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "lrucache.h"
#undef _GNU_SOURCE

static uint16_t g_lrucache_maxsize = 128;
static uint16_t g_lrucache_maxsize = 256;

uint16_t lrucache_get_maxsize(void) {
return g_lrucache_maxsize;
Expand Down

0 comments on commit cfbc218

Please sign in to comment.