---
# System prepended metadata

title: Wireshark 驗證 http keepliave on/off

---

# Wireshark 驗證 http keepliave on/off


## Case 1 : http 1.1 with keepalive
1. 用wireshark開啟pcap檔案 
2. 於上方輸入'http' 瀏覽http packets
![](https://i.imgur.com/3RLCqgk.png)

3. 點選呼叫特定api的封包
可看到header 內有keepalive,但沒有connection: close
![](https://i.imgur.com/ArAFENG.png)

4. 於封包右鍵點選follow http stream

![](https://i.imgur.com/AWiQCRx.png)
![](https://i.imgur.com/DrlH2jM.png)

可看到單一http stream中含有許多http get request

5. 於封包右鍵點選follow tcp stream

![](https://i.imgur.com/rdTshvx.png)
![](https://i.imgur.com/LvA0vx3.png)
可看到單一tcp stream中含有許多http get request


## Case 2 : http 1.1 witout keepalive

1. 用wireshark開啟pcap檔案 
2. 於上方輸入'http' 瀏覽http packets
![](https://i.imgur.com/3RLCqgk.png)

3. 點選呼叫特定api的封包
可看到header內沒有keepalive,且加上了connection: close
![](https://i.imgur.com/I6B7sga.png)

4. 於封包右鍵點選follow http stream

![](https://i.imgur.com/M4lzrlJ.png)
![](https://i.imgur.com/2ULufmo.png)


可看到單一http stream僅有一筆http request  

5. 於封包右鍵點選follow tcp stream
![](https://i.imgur.com/XiEgWQZ.png)
![](https://i.imgur.com/Km1QtBA.png)


可看到單一tcp stream中僅有一筆http get request