diff options
author | Loïc Hoguin <[email protected]> | 2013-05-30 20:21:01 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-05-30 20:21:01 +0200 |
commit | 9a2d35c2e800ee73c27b6d6cc324453c5219f715 (patch) | |
tree | fbfae2445e5aae27f67214c857f8a370cb8c3c52 /src/cowboy.erl | |
parent | c7f0834dc379053023a98a04d9fc294bc196dfa3 (diff) | |
download | cowboy-9a2d35c2e800ee73c27b6d6cc324453c5219f715.tar.gz cowboy-9a2d35c2e800ee73c27b6d6cc324453c5219f715.tar.bz2 cowboy-9a2d35c2e800ee73c27b6d6cc324453c5219f715.zip |
Add experimental and incomplete SPDY support
The SPDY connection processes are also supervisors.
Missing:
* sendfile support
* request body reading support
Diffstat (limited to 'src/cowboy.erl')
-rw-r--r-- | src/cowboy.erl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cowboy.erl b/src/cowboy.erl index f343f41..16445e1 100644 --- a/src/cowboy.erl +++ b/src/cowboy.erl @@ -17,6 +17,7 @@ -export([start_http/4]). -export([start_https/4]). +-export([start_spdy/4]). -export([stop_listener/1]). -export([set_env/3]). @@ -52,6 +53,18 @@ start_https(Ref, NbAcceptors, TransOpts, ProtoOpts) ranch:start_listener(Ref, NbAcceptors, ranch_ssl, TransOpts, cowboy_protocol, ProtoOpts). +%% @doc Start a SPDY listener. +-spec start_spdy(any(), non_neg_integer(), any(), any()) -> {ok, pid()}. +start_spdy(Ref, NbAcceptors, TransOpts, ProtoOpts) + when is_integer(NbAcceptors), NbAcceptors > 0 -> + TransOpts2 = [ + {connection_type, supervisor}, + {next_protocols_advertised, + [<<"spdy/3">>, <<"http/1.1">>, <<"http/1.0">>]} + |TransOpts], + ranch:start_listener(Ref, NbAcceptors, + ranch_ssl, TransOpts2, cowboy_spdy, ProtoOpts). + %% @doc Stop a listener. -spec stop_listener(ranch:ref()) -> ok. stop_listener(Ref) -> |