DEV Community

r6v4
r6v4

Posted on

use wireshark to test http2 on ubuntu

install wireshark on ubuntu

sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt update
sudo apt install wireshark
sudo dpkg-reconfigure wireshark-common
sudo usermod -aG wireshark $(whoami)
Enter fullscreen mode Exit fullscreen mode

start wireshark

  1. choose Loopback: lo to see 127.0.0.1 or ::1
  2. click start capturing packets
  3. input tcp.port == 1234 in filter

run example

; server
(ql:quickload 'http2/server/example)
(http2/server-example::run-demo-server :port 1234)

; client
;; curl -k https://127.0.0.1:1234/
Enter fullscreen mode Exit fullscreen mode

alpn in client-hello

0010 000e 000c 02 6832 08 687474702f312e31

  • Type: application_layer_protocol_negotiation [16] 0010
  • Length: [14] 000e
  • ALPN Extension Length: [12] 000c
  • ALPN string length: [2] 02
  • ALPN Next Protocol: [h2] 6832
  • ALPN string length: [8] 08
  • ALPN Next Protocol: [http/1.1] 687474702f312e31

alpn in server-hello

0010 0005 0003 02 6832

  • Type: application_layer_protocol_negotiation [16] 0010
  • Length: [5] 0005
  • ALPN Extension Length: [3] 0003
  • ALPN string length: [2] 02
  • ALPN Next Protocol: [h2] 6832

Top comments (0)