mirror of
https://github.com/YGGverse/agate.git
synced 2026-04-08 20:45:29 +00:00
Initial commit
This commit is contained in:
commit
1715dfb584
8 changed files with 516 additions and 0 deletions
7
src/lib.rs
Normal file
7
src/lib.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
use {
|
||||
std::{
|
||||
error::Error,
|
||||
},
|
||||
};
|
||||
|
||||
pub type Result<T=()> = std::result::Result<T, Box<dyn Error>>;
|
||||
19
src/main.rs
Normal file
19
src/main.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use {
|
||||
agate::{Result},
|
||||
rustls::{NoClientAuth, ServerConfig, ServerSession},
|
||||
std::{
|
||||
net::TcpListener,
|
||||
sync::Arc,
|
||||
},
|
||||
};
|
||||
|
||||
fn main() -> Result {
|
||||
let tls_config = Arc::new(ServerConfig::new(NoClientAuth::new()));
|
||||
// TODO: configure a certificate
|
||||
|
||||
let listener = TcpListener::bind("0.0.0.0:1965")?;
|
||||
for stream in listener.incoming() {
|
||||
let session = ServerSession::new(&tls_config);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue