Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试通过 netcat 获取此地址:
printf 'GET / HTTP/1.1\r\nHost: www.iana.org/domains/reserved\r\nConnection: close\r\n\r\n' | nc www.iana.org/domains/reserved 80
我得到错误:
nc: getaddrinfo: nodename nor servname provided, or not known
我究竟做错了什么?
路径应位于方法名称(在本例中为 GET)之后的请求行(第一行)中。目前,您告诉nc查找www.iana.org/domains/reserved将失败的主机名。此外,“主机”标头不应包含路径,仅包含主机名。
nc
www.iana.org/domains/reserved
这应该有效:
printf 'GET /domains/reserved HTTP/1.1\r\nHost: www.iana.org\r\nConnection: close\r\n\r\n' | nc www.iana.org 80
所以我决定开始用 C# 编程,我做的一件事是创建一个“pausec.exe”(pause.exe 克隆)。它可以工作,但是当像这样调用它时:
< nul pausec
……它崩溃了。我得到的错误——据我所知从西班牙语翻译成——是这样的:
未处理的异常:System.I