Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/2 support for WebSocket #369

Closed
0x676e67 opened this issue Jan 26, 2025 · 0 comments · Fixed by #373
Closed

HTTP/2 support for WebSocket #369

0x676e67 opened this issue Jan 26, 2025 · 0 comments · Fixed by #373
Labels

Comments

@0x676e67
Copy link
Owner

0x676e67 commented Jan 26, 2025

tracking

This requires server HTTP/2 EnableConnectProtocol Setting Frame. The library's dependency http2 has actually been implemented

And axum has applied HTTP2-WebSocket in the server field, which is a feature worth implementing: https://github.com/tokio-rs/axum/blob/main/examples/websockets-http2/src/main.rs

Currently, only newer versions of Safari have enabled this HTTP2 extension (UNKNOWN_SETTING_8), But it's actually useless

{
  "donate": "Please consider donating to keep this API running. Visit https://tls.peet.ws",
  "ip": "192.168.1.1:54380",
  "http_version": "h2",
  "method": "GET",
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15",
  "tls": {
    "ciphers": [
      "TLS_GREASE (0xBABA)",
      "TLS_AES_128_GCM_SHA256",
      "TLS_AES_256_GCM_SHA384",
      "TLS_CHACHA20_POLY1305_SHA256",
      "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
      "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
      "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256",
      "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
      "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
      "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256",
      "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
      "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
      "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
      "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
      "TLS_RSA_WITH_AES_256_GCM_SHA384",
      "TLS_RSA_WITH_AES_128_GCM_SHA256",
      "TLS_RSA_WITH_AES_256_CBC_SHA",
      "TLS_RSA_WITH_AES_128_CBC_SHA",
      "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA",
      "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA",
      "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
    ],
    "extensions": [
      {
        "name": "TLS_GREASE (0xbaba)"
      },
      {
        "name": "server_name (0)",
        "server_name": "tls.peet.ws"
      },
      {
        "name": "extended_master_secret (23)",
        "master_secret_data": "",
        "extended_master_secret_data": ""
      },
      {
        "name": "extensionRenegotiationInfo (boringssl) (65281)",
        "data": "00"
      },
      {
        "name": "supported_groups (10)",
        "supported_groups": [
          "TLS_GREASE (0xdada)",
          "X25519 (29)",
          "P-256 (23)",
          "P-384 (24)",
          "P-521 (25)"
        ]
      },
      {
        "name": "ec_point_formats (11)",
        "elliptic_curves_point_formats": [
          "0x00"
        ]
      },
      {
        "name": "application_layer_protocol_negotiation (16)",
        "protocols": [
          "h2",
          "http/1.1"
        ]
      },
      {
        "name": "status_request (5)",
        "status_request": {
          "certificate_status_type": "OSCP (1)",
          "responder_id_list_length": 0,
          "request_extensions_length": 0
        }
      },
      {
        "name": "signature_algorithms (13)",
        "signature_algorithms": [
          "ecdsa_secp256r1_sha256",
          "rsa_pss_rsae_sha256",
          "rsa_pkcs1_sha256",
          "ecdsa_secp384r1_sha384",
          "rsa_pss_rsae_sha384",
          "rsa_pss_rsae_sha384",
          "rsa_pkcs1_sha384",
          "rsa_pss_rsae_sha512",
          "rsa_pkcs1_sha512",
          "rsa_pkcs1_sha1"
        ]
      },
      {
        "name": "signed_certificate_timestamp (18)"
      },
      {
        "name": "key_share (51)",
        "shared_keys": [
          {
            "TLS_GREASE (0xdada)": "00"
          },
          {
            "X25519 (29)": "151269da7624ab7b8bb62be475d6ec7ec3d84fb8cdb5bfa979fb737a9ef23544"
          }
        ]
      },
      {
        "name": "psk_key_exchange_modes (45)",
        "PSK_Key_Exchange_Mode": "PSK with (EC)DHE key establishment (psk_dhe_ke) (1)"
      },
      {
        "name": "supported_versions (43)",
        "versions": [
          "TLS_GREASE (0x7a7a)",
          "TLS 1.3",
          "TLS 1.2",
          "TLS 1.1",
          "TLS 1.0"
        ]
      },
      {
        "name": "compress_certificate (27)",
        "algorithms": [
          "zlib (1)"
        ]
      },
      {
        "name": "TLS_GREASE (0xcaca)"
      },
      {
        "name": "padding (21)",
        "padding_data_length": 394
      }
    ],
    "tls_version_record": "771",
    "tls_version_negotiated": "772",
    "ja3": "771,4865-4866-4867-49196-49195-52393-49200-49199-52392-49162-49161-49172-49171-157-156-53-47-49160-49170-10,0-23-65281-10-11-16-5-13-18-51-45-43-27-21,29-23-24-25,0",
    "ja3_hash": "773906b0efdefa24a7f2b8eb6985bf37",
    "ja4": "t13d2014h2_a09f3c656075_6b9292cd260b",
    "peetprint": "GREASE-772-771-770-769|2-1.1|GREASE-29-23-24-25|1027-2052-1025-1283-2053-2053-1281-2054-1537-513|1|1|GREASE-4865-4866-4867-49196-49195-52393-49200-49199-52392-49162-49161-49172-49171-157-156-53-47-49160-49170-10|0-10-11-13-16-18-21-23-27-43-45-5-51-65281-GREASE-GREASE",
    "peetprint_hash": "fdf2c64009327d63a456cbab56a7bdde",
    "client_random": "537e2acf19b825609b28295d5c5dc0aa2c472e34a52627050fff0f727e7ab638",
    "session_id": "fab676a201e9f5ae34d19caa47602df702f99446b090411546c8c26931d23929"
  },
  "http2": {
    "akamai_fingerprint": "2:0;3:100;4:2097152;:1;9:1|10420225|0|m,s,a,p",
    "akamai_fingerprint_hash": "62317f06028f316631c157c720223e43",
    "sent_frames": [
      {
        "frame_type": "SETTINGS",
        "length": 30,
        "settings": [
          "ENABLE_PUSH = 0",
          "MAX_CONCURRENT_STREAMS = 100",
          "INITIAL_WINDOW_SIZE = 2097152",
          "UNKNOWN_SETTING_8 = 1",
          "NO_RFC7540_PRIORITIES = 1"
        ]
      },
      {
        "frame_type": "WINDOW_UPDATE",
        "length": 4,
        "increment": 10420225
      },
      {
        "frame_type": "HEADERS",
        "stream_id": 1,
        "length": 266,
        "headers": [
          ":method: GET",
          ":scheme: https",
          ":authority: tls.peet.ws",
          ":path: /api/all",
          "sec-fetch-dest: document",
          "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15",
          "accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
          "sec-fetch-site: none",
          "sec-fetch-mode: navigate",
          "accept-language: zh-CN,zh-Hans;q=0.9",
          "priority: u=0, i",
          "accept-encoding: gzip, deflate, br"
        ],
        "flags": [
          "EndStream (0x1)",
          "EndHeaders (0x4)",
          "Priority (0x20)"
        ],
        "priority": {
          "weight": 256,
          "depends_on": 0,
          "exclusive": 0
        }
      }
    ]
  },
  "tcpip": {
    "ip": {},
    "tcp": {}
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant