简体   繁体   English

chrome开发人员工具显示的HTTP协议不正确?

[英]incorrect http protocol shown by chrome developer tools?

I am checking the http protcol in use for this site http://www.dlf.in/ Chrome developer tools shows it to be http/1.1 as in the image below. 我正在检查此网站使用的http协议http://www.dlf.in/ Chrome开发者工具显示它为http / 1.1,如下图所示。

However the command line tool is-http2 or alpn in python as seems to indicate the http/1.1 is not available. 但是,命令行工具 python中的-http2或alpn,似乎表明http / 1.1不可用。 And only http1 is available. 并且只有http1可用。 What's going on here? 这里发生了什么?

I am doing the ALPN negotiation in python as follows (openssl version : OpenSSL 1.0.2h and python version 3.5.1) 我正在以如下方式在python中进行ALPN协商(openssl版本:OpenSSL 1.0.2h和python版本3.5.1)

import ssl
import socket

port = 443
domain = 'www.dlf.in'

ctx = ssl.create_default_context()
ctx.set_alpn_protocols(['h2', 'spdy/3.1', 'spdy/3', 'spdy/2', 'http/1.1'])


conn = ctx.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM),
        server_hostname=domain)

conn.connect((domain, port))
print(conn.selected_alpn_protocol())

dlf.in的chrome develper工具的网络选项卡

That site doesn't have HTTPS on it. 该站点上没有HTTPS。 Browsers only support HTTP/2 over HTTPS despite the spec allowing it over HTTP in theory. 浏览器仅支持HTTP / 2上的HTTP / 2,尽管该规范理论上允许基于HTTP。

Using telnet and HTTPie to send HTTP requests (both 1.0 and 1.1), the web server responds with: 使用telnetHTTPie发送HTTP请求(1.0和1.1),Web服务器将响应:

HTTP/1.1 200 OK HTTP / 1.1 200 OK

I tried it with 2.0 and got: 我用2.0尝试了一下,得到了:

HTTP/1.1 505 HTTP Version Not Supported 不支持HTTP / 1.1 505 HTTP版本

This site doesn't support SSL (I tried using using curl https://www.dlf.in and got the HTTP 504 response) 该网站不支持SSL(我尝试使用curl https://www.dlf.in并获得了HTTP 504响应)

Curl is a command line browser that also implements HTTP/2 in clear (non SSL) and it has the upgrade mechanism (using the --http2 flag). Curl是一种命令行浏览器,它也以清晰的方式(非SSL)实现HTTP / 2,并且具有升级机制(使用--http2标志)。 Using that flag I saw that the website doesn't support clear HTTP/2. 使用该标志,我看到该网站不支持清除HTTP / 2。 (There is an option to connect directly with HTTP/2 in clear, without the upgrade mechanism, using --http2-prior-knowledge , but it doesn't work either). (有一个选项可以使用--http2-prior-knowledge以明文形式直接与HTTP / 2直接连接,而无需升级机制,但这也不起作用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 一些http请求未出现在chrome开发人员工具中 - some http requests don't appear in chrome developer tools Chrome开发者工具找不到HttpRequest - Chrome developer tools cannot find HttpRequest $x() 始终在 Gmail 页面的 Chrome 开发者工具控制台中返回 ƒ (){} - $x() always returns ƒ (){} in Chrome Developer Tools console on gmail page Python 请求标头不起作用 - 检查 Chrome 开发者工具 -> 网络 - Python requests header not working - Checked Chrome developer tools -> Network Cookie未显示在Chrome开发者工具(Django Python)中 - Cookie does not show up in Chrome Developer Tools (Django Python) 如何使用 python 在 chrome 开发人员工具中访问网络选项卡 - How to access network tab in chrome developer tools using python 如何以编程方式复制Chrome Developer Tools中的请求? - How to programmatically replicate a request found in Chrome Developer Tools? 使用BeautifulSoup更改HTML代码并像Chrome中的开发人员工具一样“重新加载” - Change HTML Code with BeautifulSoup and “reload” like developer tools in Chrome 我可以使用 python 访问谷歌浏览器开发者工具的网络选项卡吗? - can I access to network tab of google chrome developer tools with python? 机器人框架 - 如何在测试运行期间使用 chrome 中的开发人员工具? - Robot framework - how to work with developer tools in chrome during test run?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM