天天看點

通過nc指令模拟用戶端或伺服器端程式

安裝

brew install nc      

啟動服務端(8001為端口号)

nc -l 8001      

啟動用戶端

nc 127.0.0.1 8001      

浏覽器通路

http://127.0.0.1:8001/

給浏覽器回信

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Connection: close

hello      

繼續閱讀