Update relay config info; use http3 in nginx
This commit is contained in:
parent
5137ffa34f
commit
5b2726e66d
3 changed files with 10 additions and 3 deletions
|
@ -16,9 +16,11 @@ pub async fn relay_config(header: String) -> Result<impl Reply, Rejection> {
|
|||
Err(warp::reject::not_found())
|
||||
} else {
|
||||
let res = serde_json::json!({
|
||||
"name": "Zhitno.st",
|
||||
"contact": "klink@zhitno.st",
|
||||
"name": "zhitno.st",
|
||||
"description": "Very *special* nostr relay",
|
||||
"software": "sneedstr",
|
||||
"supported_nips": [ 1, 9, 11, 12, 15, 16, 20, 22, 28, 33 ],
|
||||
"software": "git+https://git.zhitno.st/Klink/sneedstr.git",
|
||||
"version": "0.1.0"
|
||||
});
|
||||
Ok(warp::reply::json(&res))
|
||||
|
|
|
@ -13,14 +13,17 @@ fn index(context: Context) -> impl Filter<Extract = impl Reply, Error = Rejectio
|
|||
// let real_client_ip = warp::header::optional::<std::net::SocketAddr>("X-Real-IP");
|
||||
let real_client_ip = warp::addr::remote();
|
||||
let accept_application_json_header = warp::header::header("Accept");
|
||||
let cors = warp::cors().allow_any_origin();
|
||||
|
||||
warp::path::end().and(
|
||||
accept_application_json_header
|
||||
.and_then(handler::relay_config)
|
||||
.with(&cors)
|
||||
.or(warp::ws()
|
||||
.and(with_context(context))
|
||||
.and(real_client_ip)
|
||||
.and_then(handler::ws_handler)),
|
||||
.and_then(handler::ws_handler)
|
||||
.with(&cors)),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue