From f75a5416c4979ca26b1fbb8a737def8d01a20c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 20 Sep 2019 12:19:33 +0200 Subject: Supports going through multiple Socks proxies This commit also reworks the switch_protocol command. The `P | {P, Opts}` type is used here as well. This allows us to remove the code specific to Websocket. In addition a few new protocol functions allow us to declare what's the name of the options key for the protocol and what the capabilities are with regard to keepalive. --- src/gun_http2.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gun_http2.erl') diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 7dd369d..efa7afa 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -16,6 +16,8 @@ -export([check_options/1]). -export([name/0]). +-export([opts_name/0]). +-export([has_keepalive/0]). -export([init/4]). -export([switch_transport/3]). -export([handle/4]). @@ -97,6 +99,8 @@ do_check_options([Opt|_]) -> {error, {options, {http2, Opt}}}. name() -> http2. +opts_name() -> http2_opts. +has_keepalive() -> true. init(Owner, Socket, Transport, Opts0) -> %% We have different defaults than the protocol in order -- cgit v1.2.3