use chrono::offset::Local; use futures_util::future::try_join; use http::uri::Uri; use hyper::service::{make_service_fn, service_fn}; use hyper::upgrade::Upgraded; use hyper::{Body, Client, Method, Request, Response, Server}; use regex::Regex; use serde::Deserialize; use serde_dhall::StaticType; use std::convert::Infallible; use std::net::SocketAddr; use structopt::StructOpt; use tokio::net::TcpStream; #[macro_use] extern crate log; type HttpClient = Client; #[derive(Debug, StructOpt)] #[structopt()] struct Opt { #[structopt(short, long)] config: String, #[structopt(short, long, default_value = "127.0.0.1:8200")] address: SocketAddr, } #[derive(Debug, Deserialize, StaticType, Clone)] struct Access { times: Vec