Skip to content

Commit

Permalink
change earendil control my_routes to display <YOUR_IP>:PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
thisbefruit committed Dec 11, 2023
1 parent 4d4fad6 commit 5280aa8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/daemon/control_protocol_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ use moka::sync::Cache;
use nanorpc::RpcTransport;
use parking_lot::Mutex;
use serde::{Deserialize, Serialize};
use serde_json::json;
use sosistab2_obfsudp::ObfsUdpSecret;
use thiserror::Error;

use crate::{
config::{InRouteConfig, OutRouteConfig},
config::InRouteConfig,
control_protocol::{ControlProtocol, DhtError, GlobalRpcArgs, GlobalRpcError, SendMessageArgs},
daemon::DaemonContext,
global_rpc::transport::GlobalRpcTransport,
Expand Down Expand Up @@ -125,7 +126,7 @@ impl ControlProtocol for ControlProtocolImpl {
}

async fn my_routes(&self) -> serde_json::Value {
let lala: BTreeMap<String, OutRouteConfig> = self
let lala: BTreeMap<String, serde_json::Value> = self
.ctx
.config
.in_routes
Expand All @@ -136,11 +137,11 @@ impl ControlProtocol for ControlProtocolImpl {
ObfsUdpSecret::from_bytes(*blake3::hash(secret.as_bytes()).as_bytes());
(
k.clone(),
OutRouteConfig::Obfsudp {
fingerprint: self.ctx.identity.public().fingerprint(),
connect: *listen,
cookie: *secret.to_public().as_bytes(),
},
json!( {
"fingerprint": format!("{}", self.ctx.identity.public().fingerprint()),
"connect": format!("<YOUR_IP>:{}", listen.port()),
"cookie": hex::encode(secret.to_public().as_bytes()),
}),
)
}
})
Expand Down

0 comments on commit 5280aa8

Please sign in to comment.