uploaded 8 months ago
HTTP2 TLS Abstraction Layer

readme

# Abstraction layer for HTTP2 with TLS

[![Component Registry](https://components.espressif.com/components/espressif/sh2lib/badge.svg)](https://components.espressif.com/components/espressif/sh2lib)

This component contains an abstraction layer which exposes simpler set of APIs combining `nghttp2` (HTTP/2 C Library) and `esp-tls` (from ESP-IDF) components.

changelog

## 1.0.5

- Added http2_request example in the component.

readme of http2_request example

                                        
                                        # HTTP/2 Request Example

Establish an HTTP/2 connection with https://http2.github.io
- Performs a GET on /index.html

## How to use example
Before project configuration and build, be sure to set the correct chip target using `idf.py set-target <chip_name>`.

### Hardware Required

* A development board with ESP32/ESP32-S2/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
* A USB cable for power supply and programming

### Configure the project

```
idf.py menuconfig
```
Open the project configuration menu (`idf.py menuconfig`) to configure Wi-Fi or Ethernet. See "Establishing Wi-Fi or Ethernet Connection" section in [examples/protocols/README.md](../../README.md) for more details.

### Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

```
idf.py -p PORT flash monitor
```

(Replace PORT with the name of the serial port to use.)

(To exit the serial monitor, type ``Ctrl-]``.)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

## Example Output

```
I (5609) example_connect: - IPv4 address: 192.168.0.103
I (5609) example_connect: - IPv6 address: fe80:0000:0000:0000:ae67:b2ff:fe45:0194, type: ESP_IP6_ADDR_IS_LINK_LOCAL
Connecting to server
Connection done
[get-response] <!DOCTYPE HTML>
<html lang="en">
.
.
.
Body of index.html
.
.
.
.
</html>
[get-response] Frame fully received
[get-response] Stream Closed
```

                                    

Links

Supports all targets

License: Apache-2.0

To add this component to your project, run:

idf.py add-dependency "espressif/sh2lib^1.0.5"

or download archive

Dependencies

  • espressif/nghttp >=1.41.0
  • ESP-IDF >=5.0
  • Examples:

    http2_request

    more details

    To create a project from this example, run:

    idf.py create-project-from-example "espressif/sh2lib^1.0.5:http2_request"

    or download archive

    Stats

    • Downloaded in total
      Downloaded in total 132.0k times
    • Downloaded this version
      This version: 9.6k times

    Badge

    espressif/sh2lib version: 1.0.5
    |