Make the ip address type configurable.
We want to be able to use both IPv4 and IPv6.main
parent
dbf5371122
commit
f1ad05f789
|
@ -27,6 +27,12 @@ start(_Type, StartArgs) ->
|
|||
undefined -> undefined
|
||||
end,
|
||||
|
||||
Inet = case application:get_env(inet) of
|
||||
ipv4 -> inet;
|
||||
undefined -> inet;
|
||||
ipv6 -> inet6
|
||||
end,
|
||||
|
||||
{ok, Port} = application:get_env(port),
|
||||
|
||||
Dispatch = cowboy_router:compile([
|
||||
|
@ -38,6 +44,7 @@ start(_Type, StartArgs) ->
|
|||
|
||||
{ok, ListenerPid} = cowboy:start_tls(dudeswave_listener, [
|
||||
{port, Port},
|
||||
Inet,
|
||||
{ip, Addr}
|
||||
], #{env => #{dispatch => Dispatch}}),
|
||||
|
||||
|
|
Loading…
Reference in New Issue