mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
improve user experience
1. add config generator to easytier-web 2. add command to show tcp/kcp proxy entries
This commit is contained in:
@@ -177,3 +177,39 @@ service VpnPortalRpc {
|
||||
rpc GetVpnPortalInfo(GetVpnPortalInfoRequest)
|
||||
returns (GetVpnPortalInfoResponse);
|
||||
}
|
||||
|
||||
enum TcpProxyEntryTransportType {
|
||||
TCP = 0;
|
||||
KCP = 1;
|
||||
}
|
||||
|
||||
enum TcpProxyEntryState {
|
||||
Unknown = 0;
|
||||
// receive syn packet but not start connecting to dst
|
||||
SynReceived = 1;
|
||||
// connecting to dst
|
||||
ConnectingDst = 2;
|
||||
// connected to dst
|
||||
Connected = 3;
|
||||
// connection closed
|
||||
Closed = 4;
|
||||
}
|
||||
|
||||
message TcpProxyEntry {
|
||||
common.SocketAddr src = 1;
|
||||
common.SocketAddr dst = 2;
|
||||
uint64 start_time = 3;
|
||||
TcpProxyEntryState state = 4;
|
||||
TcpProxyEntryTransportType transport_type = 5;
|
||||
}
|
||||
|
||||
message ListTcpProxyEntryRequest {}
|
||||
|
||||
message ListTcpProxyEntryResponse {
|
||||
repeated TcpProxyEntry entries = 1;
|
||||
}
|
||||
|
||||
service TcpProxyRpc {
|
||||
rpc ListTcpProxyEntry(ListTcpProxyEntryRequest)
|
||||
returns (ListTcpProxyEntryResponse);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,11 @@ impl From<cidr::Ipv4Inet> for Ipv4Inet {
|
||||
|
||||
impl From<Ipv4Inet> for cidr::Ipv4Inet {
|
||||
fn from(value: Ipv4Inet) -> Self {
|
||||
cidr::Ipv4Inet::new(value.address.unwrap().into(), value.network_length as u8).unwrap()
|
||||
cidr::Ipv4Inet::new(
|
||||
value.address.unwrap_or_default().into(),
|
||||
value.network_length as u8,
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +172,9 @@ impl From<std::net::SocketAddr> for SocketAddr {
|
||||
|
||||
impl From<SocketAddr> for std::net::SocketAddr {
|
||||
fn from(value: SocketAddr) -> Self {
|
||||
if value.ip.is_none() {
|
||||
return "0.0.0.0:0".parse().unwrap();
|
||||
}
|
||||
match value.ip.unwrap() {
|
||||
socket_addr::Ip::Ipv4(ip) => std::net::SocketAddr::V4(std::net::SocketAddrV4::new(
|
||||
std::net::Ipv4Addr::from(ip),
|
||||
|
||||
@@ -207,5 +207,6 @@ message HandshakeRequest {
|
||||
}
|
||||
|
||||
message KcpConnData {
|
||||
common.SocketAddr src = 1;
|
||||
common.SocketAddr dst = 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user