fix config
This commit is contained in:
parent
5cb386c363
commit
2c66394593
@ -8,14 +8,14 @@
|
|||||||
{port, 18088}
|
{port, 18088}
|
||||||
]},
|
]},
|
||||||
|
|
||||||
{http_server, [
|
{websocket_server, [
|
||||||
{port, 18080},
|
{port, 18080},
|
||||||
{acceptors, 10},
|
{acceptors, 10},
|
||||||
{max_connections, 1024},
|
{max_connections, 1024},
|
||||||
{backlog, 256}
|
{backlog, 256}
|
||||||
]},
|
]},
|
||||||
|
|
||||||
{tls_server, [
|
{tls_server_address, [
|
||||||
{host, "localhost"},
|
{host, "localhost"},
|
||||||
{port, 443}
|
{port, 443}
|
||||||
]},
|
]},
|
||||||
|
|||||||
@ -14,7 +14,7 @@ start(_StartType, _StartArgs) ->
|
|||||||
io:setopts([{encoding, unicode}]),
|
io:setopts([{encoding, unicode}]),
|
||||||
%% 加速内存的回收
|
%% 加速内存的回收
|
||||||
erlang:system_flag(fullsweep_after, 16),
|
erlang:system_flag(fullsweep_after, 16),
|
||||||
start_http_server(),
|
start_websocket_server(),
|
||||||
|
|
||||||
efka_sup:start_link().
|
efka_sup:start_link().
|
||||||
|
|
||||||
@ -23,9 +23,9 @@ stop(_State) ->
|
|||||||
ok.
|
ok.
|
||||||
|
|
||||||
%% 微服务和efka之间通过websocket协议通讯
|
%% 微服务和efka之间通过websocket协议通讯
|
||||||
-spec start_http_server() -> ok.
|
-spec start_websocket_server() -> ok.
|
||||||
start_http_server() ->
|
start_websocket_server() ->
|
||||||
{ok, Props} = application:get_env(efka, http_server),
|
{ok, Props} = application:get_env(efka, websocket_server),
|
||||||
Acceptors = proplists:get_value(acceptors, Props, 50),
|
Acceptors = proplists:get_value(acceptors, Props, 50),
|
||||||
MaxConnections = proplists:get_value(max_connections, Props, 10240),
|
MaxConnections = proplists:get_value(max_connections, Props, 10240),
|
||||||
Backlog = proplists:get_value(backlog, Props, 1024),
|
Backlog = proplists:get_value(backlog, Props, 1024),
|
||||||
|
|||||||
@ -275,7 +275,7 @@ auth_packet(PktId) when is_integer(PktId) ->
|
|||||||
|
|
||||||
-spec connect_socket() -> {ok, ssl:sslsocket()} | {error, term()}.
|
-spec connect_socket() -> {ok, ssl:sslsocket()} | {error, term()}.
|
||||||
connect_socket() ->
|
connect_socket() ->
|
||||||
{ok, Props} = application:get_env(efka, tls_server),
|
{ok, Props} = application:get_env(efka, tls_server_address),
|
||||||
Host = proplists:get_value(host, Props),
|
Host = proplists:get_value(host, Props),
|
||||||
Port = proplists:get_value(port, Props),
|
Port = proplists:get_value(port, Props),
|
||||||
SslOptions = [
|
SslOptions = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user