Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 065b539

Browse files
committed
Merge pull request #228 from Lukasa/cli-fix
Force the NPN/ALPN protocol with the Hyper command-line client.
2 parents 11e0f2a + 784e57b commit 065b539

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

hyper/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def make_troubleshooting_argument(parser):
108108
help='Show debugging information (loglevel=DEBUG)')
109109
parser.add_argument(
110110
'--h2', action='store_true', default=False,
111-
help="Do HTTP/2 directly in plaintext: skip plaintext upgrade")
111+
help="Do HTTP/2 directly, skipping plaintext upgrade and ignoring "
112+
"NPN/ALPN."
113+
)
112114

113115

114116
def split_host_and_port(hostname):
@@ -236,7 +238,10 @@ def request(args):
236238
)
237239
else: # pragma: no cover
238240
conn = HTTP20Connection(
239-
args.url.host, args.url.port, secure=args.url.secure
241+
args.url.host,
242+
args.url.port,
243+
secure=args.url.secure,
244+
force_proto='h2'
240245
)
241246

242247
conn.request(args.method, args.url.path, args.body, args.headers)

0 commit comments

Comments
 (0)