fix
This commit is contained in:
parent
ed01e7dec9
commit
500c1eebe8
@ -52,7 +52,7 @@ start_link(Args) when is_list(Args) ->
|
|||||||
{ok, State :: #state{}} | {ok, State :: #state{}, timeout() | hibernate} |
|
{ok, State :: #state{}} | {ok, State :: #state{}, timeout() | hibernate} |
|
||||||
{stop, Reason :: term()} | ignore).
|
{stop, Reason :: term()} | ignore).
|
||||||
init([]) ->
|
init([]) ->
|
||||||
{ok, DnsServers} = application:get_env(dns_proxy, public_dns_servers),
|
{ok, DnsServers} = application:get_env(sdlan, public_dns_servers),
|
||||||
|
|
||||||
{ok, Sock} = gen_udp:open(0, [binary, {active, true}]),
|
{ok, Sock} = gen_udp:open(0, [binary, {active, true}]),
|
||||||
%% 通过ets来保存映射关系
|
%% 通过ets来保存映射关系
|
||||||
|
|||||||
@ -7,7 +7,7 @@ start_link(Port) when is_integer(Port) ->
|
|||||||
init(Port) ->
|
init(Port) ->
|
||||||
dns_cache:init(),
|
dns_cache:init(),
|
||||||
{ok, Sock} = gen_udp:open(Port, [binary, {active, true}]),
|
{ok, Sock} = gen_udp:open(Port, [binary, {active, true}]),
|
||||||
io:format("DNS Forwarder started on UDP port ~p~n", [Port]),
|
lager:debug("[dns_server] DNS Forwarder started on UDP port ~p~n", [Port]),
|
||||||
loop(Sock).
|
loop(Sock).
|
||||||
|
|
||||||
loop(Sock) ->
|
loop(Sock) ->
|
||||||
|
|||||||
@ -23,6 +23,12 @@
|
|||||||
|
|
||||||
% {stun_servers, [{'sdlan_stun:2:1', 1265}, {'sdlan_stun:2:2', 1266}]},
|
% {stun_servers, [{'sdlan_stun:2:1', 1265}, {'sdlan_stun:2:2', 1266}]},
|
||||||
|
|
||||||
|
%% 公共的dns域名解析服务
|
||||||
|
{public_dns_servers, [
|
||||||
|
{{114, 114, 114, 114}, 53},
|
||||||
|
{{8,8,8,8}, 53}
|
||||||
|
]},
|
||||||
|
|
||||||
{pools, [
|
{pools, [
|
||||||
%% mysql连接池配置
|
%% mysql连接池配置
|
||||||
{mysql_sdlan,
|
{mysql_sdlan,
|
||||||
@ -37,7 +43,13 @@
|
|||||||
{database, "sdlan"},
|
{database, "sdlan"},
|
||||||
{queries, [<<"set names utf8">>]}
|
{queries, [<<"set names utf8">>]}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{dns_resolver_pool,
|
||||||
|
[{size, 20}, {max_overflow, 100}, {worker_module, dns_resolver}],
|
||||||
|
[]
|
||||||
}
|
}
|
||||||
|
|
||||||
]},
|
]},
|
||||||
|
|
||||||
{api_url, "https://punchnet.aioe.tech/api/"}
|
{api_url, "https://punchnet.aioe.tech/api/"}
|
||||||
@ -49,22 +61,6 @@
|
|||||||
{access_context, sync_transaction}
|
{access_context, sync_transaction}
|
||||||
]},
|
]},
|
||||||
|
|
||||||
{dns_proxy, [
|
|
||||||
|
|
||||||
%% 公共的dns域名解析服务
|
|
||||||
{public_dns_servers, [
|
|
||||||
{{114, 114, 114, 114}, 53},
|
|
||||||
{{8,8,8,8}, 53}
|
|
||||||
]},
|
|
||||||
|
|
||||||
{dns_resolver_pool, [
|
|
||||||
{size, 20},
|
|
||||||
{max_overflow, 100},
|
|
||||||
{worker_module, dns_resolver}
|
|
||||||
]}
|
|
||||||
|
|
||||||
]},
|
|
||||||
|
|
||||||
%% 系统日志配置,系统日志为lager, 支持日志按日期自动分割
|
%% 系统日志配置,系统日志为lager, 支持日志按日期自动分割
|
||||||
{lager, [
|
{lager, [
|
||||||
{colored, true},
|
{colored, true},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user