From 23fc8e2a89058d2f96ff64c0bc0dff637662995c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 27 May 2016 12:45:55 +0200 Subject: Initial HTTP/2 support A number of things are not implemented, but this is enough to connect to Twitter and get a response sent back. It also currently doesn't have tests. --- test/twitter_SUITE.erl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/twitter_SUITE.erl b/test/twitter_SUITE.erl index 86f9a85..6cd53c4 100644 --- a/test/twitter_SUITE.erl +++ b/test/twitter_SUITE.erl @@ -16,11 +16,24 @@ -compile(export_all). all() -> - [spdy]. + [http, http2, spdy]. + +http(_) -> + {ok, Pid} = gun:open("twitter.com", 443, #{protocols => [http]}), + {ok, http} = gun:await_up(Pid), + common(Pid). + +http2(_) -> + {ok, Pid} = gun:open("twitter.com", 443, #{protocols => [http2]}), + {ok, http2} = gun:await_up(Pid), + common(Pid). spdy(_) -> - {ok, Pid} = gun:open("twitter.com", 443), + {ok, Pid} = gun:open("twitter.com", 443, #{protocols => [spdy]}), {ok, spdy} = gun:await_up(Pid), + common(Pid). + +common(Pid) -> Ref = gun:get(Pid, "/"), receive {gun_response, Pid, Ref, nofin, Status, Headers} -> -- cgit v1.2.3