mirror of
https://github.com/DNSCrypt/doh-server.git
synced 2025-04-03 04:57:37 +03:00
Format
This commit is contained in:
parent
ab4c27ef86
commit
5b11bc520e
5 changed files with 28 additions and 23 deletions
|
@ -1,6 +1,7 @@
|
|||
use hyper::StatusCode;
|
||||
use std::io;
|
||||
|
||||
use hyper::StatusCode;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum DoHError {
|
||||
Incomplete,
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
use crate::odoh::ODoHRotator;
|
||||
use std::net::SocketAddr;
|
||||
#[cfg(feature = "tls")]
|
||||
use std::path::PathBuf;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use tokio::runtime;
|
||||
|
||||
#[cfg(feature = "tls")]
|
||||
use std::path::PathBuf;
|
||||
use crate::odoh::ODoHRotator;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Globals {
|
||||
|
|
|
@ -6,9 +6,10 @@ pub mod odoh;
|
|||
#[cfg(feature = "tls")]
|
||||
mod tls;
|
||||
|
||||
use crate::constants::*;
|
||||
pub use crate::errors::*;
|
||||
pub use crate::globals::*;
|
||||
use std::net::SocketAddr;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use byteorder::{BigEndian, ByteOrder};
|
||||
use futures::prelude::*;
|
||||
|
@ -16,14 +17,14 @@ use futures::task::{Context, Poll};
|
|||
use hyper::http;
|
||||
use hyper::server::conn::Http;
|
||||
use hyper::{Body, HeaderMap, Method, Request, Response, StatusCode};
|
||||
use std::net::SocketAddr;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
|
||||
use tokio::net::{TcpListener, TcpSocket, UdpSocket};
|
||||
use tokio::runtime;
|
||||
|
||||
use crate::constants::*;
|
||||
pub use crate::errors::*;
|
||||
pub use crate::globals::*;
|
||||
|
||||
pub mod reexports {
|
||||
pub use tokio;
|
||||
}
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
use crate::constants::ODOH_KEY_ROTATION_SECS;
|
||||
use crate::errors::DoHError;
|
||||
use arc_swap::ArcSwap;
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use arc_swap::ArcSwap;
|
||||
use odoh_rs::{
|
||||
Deserialize, ObliviousDoHConfig, ObliviousDoHConfigs, ObliviousDoHKeyPair, ObliviousDoHMessage,
|
||||
ObliviousDoHMessagePlaintext, OdohSecret, ResponseNonce, Serialize,
|
||||
};
|
||||
use rand::Rng;
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::runtime;
|
||||
|
||||
use crate::constants::ODOH_KEY_ROTATION_SECS;
|
||||
use crate::errors::DoHError;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ODoHPublicKey {
|
||||
key_pair: ObliviousDoHKeyPair,
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
use crate::constants::CERTS_WATCH_DELAY_SECS;
|
||||
use crate::errors::*;
|
||||
use crate::{DoH, LocalExecutor};
|
||||
|
||||
use futures::{future::FutureExt, join, select};
|
||||
use hyper::server::conn::Http;
|
||||
use std::fs::File;
|
||||
use std::io::{self, BufReader, Cursor, Read};
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use futures::{future::FutureExt, join, select};
|
||||
use hyper::server::conn::Http;
|
||||
use tokio::{
|
||||
net::TcpListener,
|
||||
sync::mpsc::{self, Receiver},
|
||||
|
@ -18,6 +15,10 @@ use tokio_rustls::{
|
|||
TlsAcceptor,
|
||||
};
|
||||
|
||||
use crate::constants::CERTS_WATCH_DELAY_SECS;
|
||||
use crate::errors::*;
|
||||
use crate::{DoH, LocalExecutor};
|
||||
|
||||
pub fn create_tls_acceptor<P, P2>(certs_path: P, certs_keys_path: P2) -> io::Result<TlsAcceptor>
|
||||
where
|
||||
P: AsRef<Path>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue