mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Add experimental and incomplete SPDY support
The SPDY connection processes are also supervisors. Missing: * sendfile support * request body reading support
This commit is contained in:
parent
c7f0834dc3
commit
9a2d35c2e8
7 changed files with 980 additions and 35 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue