http2

Node.js HTTP2 server Error: socket hang up

自作多情 提交于 2019-11-29 13:41:23
Given the latest version of Node.js with experimental HTTP2 support: $ node -v v9.2.0 An HTTP2 server: var options = { key: getKey(), cert: getCert(), allowHTTP1: true } var server = http2.createSecureServer(options) server.on('stream', onstream) server.on('error', onerror) server.on('connect', onconnect) server.on('socketError', onsocketerror) server.on('frameError', onframeerror) server.on('remoteSettings', onremotesettings) server.listen(8443) function onconnect() { console.log('connect') } function onremotesettings(settings) { console.log('remote settings', settings) } function

How to customise “host” header in Java http client

跟風遠走 提交于 2019-11-29 11:11:49
Here's my code: HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("http://127.0.0.1:8081/")) .header("Host", "test.example.com") .build(); client.send(request, HttpResponse.BodyHandlers.ofString()); As a result I see that the above code sends: GET / HTTP/1.1 Connection: Upgrade, HTTP2-Settings Content-Length: 0 Host: 127.0.0.1:8081 HTTP2-Settings: AAEAAEAAAAIAAAABAAMAAABkAAQBAAAAAAUAAEAA Upgrade: h2c User-Agent: Java-http-client/10 Host: test.example.com As you can see it sends two Host headers (the one from URI and the one I

apns http2 api not returning status 410 after uninstalling app

◇◆丶佛笑我妖孽 提交于 2019-11-29 10:49:19
Im using apns with http2 protocol for sending pushnotifications, the code i use is similar to this post: https://stackoverflow.com/a/34831873/1546652 When my app is correctly installed the apns http2 api works ok while sending messages, my reponse is something of the style : {"response":"","httpcode":200} The problem is that when i uninstall the app and send a pushnotification to the invalid registrationId i dont receive status 410 nor the response "reason:Unregistered" and still receive a true response with status 200. How can i receive 410 status and correspondig response when unistall the

Does the per-host connection limit is raised with HTTP/2?

独自空忆成欢 提交于 2019-11-29 09:08:21
Browsers have a per-host limit regarding number of parallel XHR (about 6 nowadays). Does this restriction apply to multiplexed HTTP/2 connections? Browsers impose a per-domain limit of 6-8 connections when using HTTP/1.1, depending on the browser implementation. This allows at most 6-8 concurrent requests per domain. With HTTP/2, browsers open only 1 connection per domain. However, thanks to the multiplexing feature of the HTTP/2 protocol, the number of concurrent requests per domain is not limited to 6-8, but it is virtually unlimited. It is virtually unlimited in the sense that browsers and

Does the browser cancel server push when a resource is in cache?

不想你离开。 提交于 2019-11-29 01:43:03
问题 The HTTP/2 specification indicates that any resource identified in a PUSH_PROMISE frame won't be pushed if the client cancels it. When a browser detects a resource already in the cache, it should cancel the push for this resource. However, I don't see how the browser can detect it. Do the frames provide additional informations like etag or last modified to allow the browser to detect if any cache entry must be evicted or if the push could be canceled? If it's possible, some bandwidth could be

Purpose of Pseudo/Colon Header Fields

柔情痞子 提交于 2019-11-29 01:32:15
As the title suggests, I'm looking for some information on the purpose of pseudo/colon header fields, i.e. I want to know why we have a second type of header field... Also - I know pseudo/colon header fields are used in http2 in place of the message and status lines (^^^the reason for which I don't know^^^); but are pseudo/colon header fields used in http1 to relay different information (from status and request)? The purpose of the pseudo header fields was to unify the way the request/response information was carried in SPDY and later in HTTP/2 (which is based on SPDY). When SPDY was designed

Java 9 HttpClient send a multipart/form-data request

不羁岁月 提交于 2019-11-28 23:51:17
Below is a form: <form action="/example/html5/demo_form.asp" method="post" enctype=”multipart/form-data”> <input type="file" name="img" /> <input type="text" name=username" value="foo"/> <input type="submit" /> </form> when will submit this form, the request will look like this: POST /example/html5/demo_form.asp HTTP/1.1 Host: 10.143.47.59:9093 Connection: keep-alive Content-Length: 326 Accept: application/json, text/javascript, */*; q=0.01 Origin: http://10.143.47.59:9093 X-Requested-With: XMLHttpRequest User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)

Disabling HTTP/2 / SPDY in HTTP.SYS and IIS in Windows 10

筅森魡賤 提交于 2019-11-28 23:35:04
When testing on Windows 10 we were seeing lots of browser incompatibilities that I hadn't seen before with earlier Windows versions. Some browsers would work, but others would report ERR_SPDY_PROTOCOL_ERROR. My quick search for this problem showed I was not alone. My app uses WWSAPI and HTTP.SYS with HTTPS (TLS). Does anyone know how to disable SPDY / HTTP/2 in WWSAPI (which is using HTTP.SYS) on Windows 10? I'd also love to get a full up-to-date Windows 10 list of registry settings for HTTP.SYS. See below for my answer to this. Hope this helps others too. Mark EDIT: disabling HTTP/2 will

Enable http2 with Tomcat in Spring Boot

对着背影说爱祢 提交于 2019-11-28 16:22:39
Tomcat 8.5 , which will be the default in Spring Boot 1.4 , (to be released tomorrow) supports http2 . How can http2 be enabled in a Spring Boot application? You need to add the HTTP 2 upgrade protocol to Tomcat's connector. You can do that by customizing the embedded Tomcat container: Java 8: @Bean public EmbeddedServletContainerCustomizer tomcatCustomizer() { return (container) -> { if (container instanceof TomcatEmbeddedServletContainerFactory) { ((TomcatEmbeddedServletContainerFactory) container) .addConnectorCustomizers((connector) -> { connector.addUpgradeProtocol(new Http2Protocol()); }

Why do web browsers not support h2c (HTTP/2 without TLS)?

怎甘沉沦 提交于 2019-11-28 09:00:33
I really search the web, and I can not find the reason why web browsers do not support h2c (http/2 with no TLS). Any idea, appreciated. A little bit clarification http/2 with https uses ALPN (this is called h2). http/2 with http does not need ALPN(this is called h2c), but almost no web browser support it. Why is so? I feel that for many resources, there is no need for confidentiality though authenticity is always good (the digital signature of the http body is not widely supported though there are some private implementations). Given confidentiality is not needed, then h2c is really a good