# http/2

`HTTP/2.0` is supported across the available [server implementations](/doc/servers). To enable `HTTP/2.0` you need to set these properties:

```
server.http2.enabled = true

application.securePort = 8443
```

Or programmatically like:

```java
{
  // HTTP/2.0 clear text (a.k.a h2c)
  http2();

  // HTTP/2.0 over TLS
  securePort(8443);

  get("/", req -> req.protocol());
}
```

Browsers don't support `H2C` (H2 clear text) which is why you need to configure [HTTPS](/doc/#https) as well.

At `bootstrap time` you will see a `+h2` flag that indicates that `HTTP/2.0` is enabled:

```
   http://localhost:8080/ +h2
   https://localhost:8443/ +h2
```

Some servers require special configuration (besides [HTTPS](/doc/#https)). So it's always good practice to check the `HTTP/2.0` section of the server implementation to learn more about current support, limitations and/or configuration steps.

## server push

Server push is supported via [Request.push]({{defdocs}}/Request.html#push-java.lang.String-):

```java
{
  // HTTP/2.0 clear text (a.k.a h2c)
  http2();

  // HTTP/2.0 over TLS
  securePort(8443);

  assets("/js/**");

  get("/", req -> {

    req.push("/js/home.js");

    return Results.html("home");
  });
}
```

When the *browser* requests the `home` page, we will send the `/js/home.js` resource as well!

That's all, but keep in mind that each server implementation might require some extra configuration steps to work, please check out the [server documentation](/doc/servers) for more details.
