We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc4213b commit 7d92fcdCopy full SHA for 7d92fcd
1 file changed
src/cowboy_bridge_modules/cowboy_simple_bridge_sup.erl
@@ -27,8 +27,15 @@ init([]) ->
27
{Address, Port} = simple_bridge_util:get_address_and_port(cowboy),
28
IP = simple_bridge_util:parse_ip(Address),
29
30
- io:format("Starting Cowboy Server on ~p:~p~n",
31
- [IP, Port]),
+ {Schema, F, TOpts} = case simple_bridge_util:get_env(tls) of
+ undefined -> {http, start_http, []};
32
+ [_|_] = O -> {https, start_https, O}
33
+ end,
34
+
35
36
+ io:format("Starting Cowboy ~p Server on ~p:~p~n",
37
+ [Schema, IP, Port]),
38
39
40
Dispatch = generate_dispatch(),
41
io:format("Using Cowboy Dispatch Table:~n ~p~n",[Dispatch]),
@@ -38,7 +45,7 @@ init([]) ->
45
{max_keepalive, 100}
46
],
47
- cowboy:start_http(http, 100, [{ip, IP}, {port, Port}], Opts),
48
+ cowboy:F(Schema, 100, [{ip, IP}, {port, Port}| TOpts], Opts),
42
49
43
50
{ok, { {one_for_one, 5, 10}, []}}.
44
51
0 commit comments