Module http

Module http 

Source
Available on crate feature http only.
Expand description

Header types for Fly- edge proxy request headers, like Fly-Client-IP.

use axum::response::Html;
use axum_extra::TypedHeader;
use flytrap::http::{FlyClientIp, FlyRegion};

async fn ip(
    TypedHeader(FlyClientIp(ip)): TypedHeader<FlyClientIp>,
    TypedHeader(FlyRegion(edge)): TypedHeader<FlyRegion>,
) -> Html<String> {
    Html(format!("Your IP: <code>{ip}</code> (via {edge})"))
}

Structs§

FlyClientIp
The Fly-Client-IP header: the IP address that Fly.io accepted the incoming connection from.
FlyForwardedPort
The Fly-Forwarded-Port header: the port that the client connected to the Fly.io edge.
FlyRegion
The Fly-Region header: the Fly.io edge region where the client’s connection was accepted from the Internet.

Statics§

FLY_CLIENT_IP
The name for the Fly-Client-IP HTTP header.
FLY_FORWARDED_PORT
The name for the Fly-Forwarded-Port HTTP header.
FLY_REGION
The name for the Fly-Region HTTP header.