Skip to content

Commit

Permalink
Merge branch 'stuart-thackray-master'
Browse files Browse the repository at this point in the history
Conflicts:
	src/yaws_bridge_modules/yaws_simple_bridge_sup.erl
  • Loading branch information
choptastic committed Sep 24, 2015
2 parents 712d1fb + aeca36e commit f64788d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions etc/simple_bridge.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@
%% This is the location of the temp directory where uploaded files will
%% be placed.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% BACKEND-CONFIG
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{websocket_interval, 10000}
% Websocket check if socket is there (milliseconds). Default is 10000
{websocket_timeout, 5000}
%% Weboscket timeout (milliseconds) Default is 5000


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% BACKEND-SPECIFIC DISPATCH TABLES:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
7 changes: 6 additions & 1 deletion src/yaws_bridge_modules/yaws_simple_bridge_sup.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ init([]) ->
start_embedded_yaws() ->
{DocRoot, StaticPaths} = simple_bridge_util:get_docroot_and_static_paths(yaws),
{Address, Port} = simple_bridge_util:get_address_and_port(yaws),
{_KeepAliveInterval, Timeout} = simple_bridge_util:get_websocket_keepalive_interval_timeout(yaws),
RealAddress = simple_bridge_util:parse_ip(Address),
Servername = simple_bridge_util:to_list(simple_bridge_util:get_server_name(yaws)),
Anchor = simple_bridge_util:get_anchor_module(yaws),
%% Max post is in MB but yaws wants bytes
MaxPost = simple_bridge_util:get_max_post_size(yaws) * 1048576,
ExcludePaths = [filename:split(P) || P <- StaticPaths],
Appmods = [{"/", Anchor, ExcludePaths}],

Expand All @@ -48,11 +51,13 @@ start_embedded_yaws() ->
{listen, RealAddress},
{port, Port},
{allowed_scripts, []},
{partial_post_size, MaxPost},
{index_files, ["index.html"]},
{appmods, Appmods}
],

GConf = [{id, Servername}],
GConf = [{id, Servername},
{keepalive_timeout, Timeout}],
io:format("Starting Yaws Server at ~p:~p~n", [Address, Port]),
io:format("Static Paths: ~p~nDocument Root for Static: ~s~n", [StaticPaths, DocRoot]),
yaws:start_embedded(DocRoot, SConf, GConf, Servername).

0 comments on commit f64788d

Please sign in to comment.