Skip to content

Instantly share code, notes, and snippets.

@lwzm
Created June 23, 2014 11:39
Show Gist options
  • Select an option

  • Save lwzm/51299b13ad5bc49acda7 to your computer and use it in GitHub Desktop.

Select an option

Save lwzm/51299b13ad5bc49acda7 to your computer and use it in GitHub Desktop.

用 nc, curl 观察 http 协议, 和 cat 配合.

nc 充当服务器: nc -l 8000 >http_request curl -v http://localhost:8000 得到 http_request, 与 curl 显示的一致

启动普通的 HTTP 服务器, 用 nc 做客户端: cat http_request - | nc localhost 8000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment