fix more warnings and add script to check all editions
This commit is contained in:
parent
a88f1898a5
commit
7f27ad0a3c
14 changed files with 38 additions and 91 deletions
|
|
@ -1,17 +0,0 @@
|
|||
use once_cell::sync::Lazy;
|
||||
use std::env;
|
||||
use std::net::SocketAddrV4;
|
||||
|
||||
pub static EDGE_NODE_HOLDER: Lazy<SocketAddrV4> = Lazy::new(|| {
|
||||
env::var("EDGE_NODE_HOLDER")
|
||||
.ok()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("EDGE_NODE_HOLDER not set")
|
||||
});
|
||||
|
||||
pub static FORWARD_DESTINATION: Lazy<SocketAddrV4> = Lazy::new(|| {
|
||||
env::var("FORWARD_DESTINATION")
|
||||
.ok()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("FORWARD_DESTINATION not set")
|
||||
});
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
pub mod common;
|
||||
pub mod proxy_insecure;
|
||||
pub mod proxy_secure;
|
||||
|
|
|
|||
|
|
@ -1,45 +1,19 @@
|
|||
use crate::executables::common::{EDGE_NODE_HOLDER, FORWARD_DESTINATION};
|
||||
use crate::prudp::router::Router;
|
||||
use crate::prudp::unsecure::Unsecure;
|
||||
use log::error;
|
||||
use rnex_core::common::setup;
|
||||
use rnex_core::executables::common::{OWN_IP_PRIVATE, OWN_IP_PUBLIC, SERVER_PORT};
|
||||
use proxy_common::{ProxyStartupParam, RNEX_ACCESS_KEY};
|
||||
use rnex_core::prudp::virtual_port::VirtualPort;
|
||||
use rnex_core::reggie::EdgeNodeHolderConnectOption::Register;
|
||||
use rnex_core::reggie::RemoteEdgeNodeHolder;
|
||||
use rnex_core::reggie::UnitPacketRead;
|
||||
use rnex_core::reggie::UnitPacketWrite;
|
||||
use rnex_core::rmc::protocols::{OnlyRemote, new_rmc_gateway_connection};
|
||||
use rnex_core::rmc::structures::RmcSerialize;
|
||||
use rnex_core::rnex_proxy_common::ConnectionInitData;
|
||||
use rnex_core::util::SplittableBufferConnection;
|
||||
use std::net::SocketAddrV4;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::task;
|
||||
use tokio::time::sleep;
|
||||
use proxy_common::RNEX_ACCESS_KEY;
|
||||
|
||||
pub async fn start() {
|
||||
/*let conn = tokio::net::TcpStream::connect(&*EDGE_NODE_HOLDER)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let conn: SplittableBufferConnection = conn.into();
|
||||
|
||||
conn.send(
|
||||
Register(SocketAddrV4::new(*OWN_IP_PUBLIC, *SERVER_PORT))
|
||||
.to_data()
|
||||
.unwrap(),
|
||||
)
|
||||
.await;
|
||||
|
||||
let conn = new_rmc_gateway_connection(conn, |r| {
|
||||
Arc::new(OnlyRemote::<RemoteEdgeNodeHolder>::new(r))
|
||||
});*/
|
||||
|
||||
let (router_secure, _) = Router::new(SocketAddrV4::new(*OWN_IP_PRIVATE, *SERVER_PORT))
|
||||
pub async fn start(param: ProxyStartupParam) {
|
||||
let (router_secure, _) = Router::new(param.self_private)
|
||||
.await
|
||||
.expect("unable to start router");
|
||||
|
||||
|
|
@ -48,8 +22,6 @@ pub async fn start() {
|
|||
.await
|
||||
.expect("unable to add socket");
|
||||
|
||||
// let conn = socket_secure.connect(auth_sockaddr).await.unwrap();
|
||||
|
||||
loop {
|
||||
let Some(mut conn) = socket_secure.accept().await else {
|
||||
error!("server crashed");
|
||||
|
|
@ -57,7 +29,7 @@ pub async fn start() {
|
|||
};
|
||||
|
||||
task::spawn(async move {
|
||||
let mut stream = match TcpStream::connect(*FORWARD_DESTINATION).await {
|
||||
let mut stream = match TcpStream::connect(param.forward_destination).await {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
error!("unable to connect: {}", e);
|
||||
|
|
|
|||
|
|
@ -1,30 +1,20 @@
|
|||
use crate::executables::common::{EDGE_NODE_HOLDER, FORWARD_DESTINATION};
|
||||
use crate::prudp::router::Router;
|
||||
use crate::prudp::secure::Secure;
|
||||
use log::error;
|
||||
use rnex_core::common::setup;
|
||||
use rnex_core::executables::common::{
|
||||
OWN_IP_PRIVATE, OWN_IP_PUBLIC, SECURE_SERVER_ACCOUNT, SERVER_PORT,
|
||||
};
|
||||
use proxy_common::{ProxyStartupParam, RNEX_ACCESS_KEY};
|
||||
use rnex_core::executables::common::SECURE_SERVER_ACCOUNT;
|
||||
use rnex_core::prudp::virtual_port::VirtualPort;
|
||||
use rnex_core::reggie::EdgeNodeHolderConnectOption::Register;
|
||||
use rnex_core::reggie::RemoteEdgeNodeHolder;
|
||||
use rnex_core::reggie::UnitPacketRead;
|
||||
use rnex_core::reggie::UnitPacketWrite;
|
||||
use rnex_core::rmc::protocols::{OnlyRemote, new_rmc_gateway_connection};
|
||||
use rnex_core::rmc::structures::RmcSerialize;
|
||||
use rnex_core::rnex_proxy_common::ConnectionInitData;
|
||||
use rnex_core::util::SplittableBufferConnection;
|
||||
use std::net::SocketAddrV4;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use tokio::net::TcpStream;
|
||||
use tokio::task;
|
||||
use tokio::time::sleep;
|
||||
use proxy_common::RNEX_ACCESS_KEY;
|
||||
|
||||
pub async fn start() {
|
||||
let (router_secure, _) = Router::new(SocketAddrV4::new(*OWN_IP_PRIVATE, *SERVER_PORT))
|
||||
pub async fn start(param: ProxyStartupParam) {
|
||||
let (router_secure, _) = Router::new(param.self_private)
|
||||
.await
|
||||
.expect("unable to start router");
|
||||
|
||||
|
|
@ -36,8 +26,6 @@ pub async fn start() {
|
|||
.await
|
||||
.expect("unable to add socket");
|
||||
|
||||
// let conn = socket_secure.connect(auth_sockaddr).await.unwrap();
|
||||
|
||||
loop {
|
||||
let Some(mut conn) = socket_secure.accept().await else {
|
||||
error!("server crashed");
|
||||
|
|
@ -45,7 +33,7 @@ pub async fn start() {
|
|||
};
|
||||
|
||||
task::spawn(async move {
|
||||
let mut stream = match TcpStream::connect(*FORWARD_DESTINATION).await {
|
||||
let mut stream = match TcpStream::connect(param.forward_destination).await {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
error!("unable to connect: {}", e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue