/*
* Copyright (c)2013-2021 ZeroTier, Inc.
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file in the project's root directory.
*
* Change Date: 2026-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2.0 of the Apache License.
*/
/****/
use std::cell::RefCell;
use std::convert::Infallible;
use std::net::SocketAddr;
use hyper::{Body, Request, Response};
use hyper::server::Server;
use hyper::service::{make_service_fn, service_fn};
use tokio::task::JoinHandle;
use crate::service::Service;
#[cfg(target_os = "linux")]
use std::os::unix::io::AsRawFd;
/// Handles API dispatch and other HTTP handler stuff.
async fn web_handler(service: Service, req: Request
) -> Result, Infallible> {
Ok(Response::new("Hello, World".into()))
}
/// Listener for http connections to the API or for TCP P2P.
/// Dropping a listener initiates shutdown of the background hyper Server instance,
/// but it might not shut down instantly as this occurs asynchronously.
pub(crate) struct WebListener {
pub address: SocketAddr,
shutdown_tx: RefCell