-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,647 additions
and
292 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[workspace] | ||
resolver = "2" | ||
|
||
members = [ | ||
"crates/*", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
cargo run --release -- \ | ||
--connector-protocol tcp \ | ||
--connector-addr 127.0.0.1:13001 \ | ||
--http-dest 127.0.0.1:8080 \ | ||
--https-dest 127.0.0.1:8443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Serialize, Deserialize)] | ||
pub struct ClusterTunnelRequest { | ||
pub domain: String, | ||
} | ||
|
||
impl From<&ClusterTunnelRequest> for Vec<u8> { | ||
fn from(resp: &ClusterTunnelRequest) -> Self { | ||
bincode::serialize(resp).expect("Should ok") | ||
} | ||
} | ||
|
||
impl TryFrom<&[u8]> for ClusterTunnelRequest { | ||
type Error = bincode::Error; | ||
|
||
fn try_from(buf: &[u8]) -> Result<Self, Self::Error> { | ||
bincode::deserialize(buf) | ||
} | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize)] | ||
pub struct ClusterTunnelResponse { | ||
pub success: bool, | ||
} | ||
|
||
impl From<&ClusterTunnelResponse> for Vec<u8> { | ||
fn from(resp: &ClusterTunnelResponse) -> Self { | ||
bincode::serialize(resp).expect("Should ok") | ||
} | ||
} | ||
|
||
impl TryFrom<&[u8]> for ClusterTunnelResponse { | ||
type Error = bincode::Error; | ||
|
||
fn try_from(buf: &[u8]) -> Result<Self, Self::Error> { | ||
bincode::deserialize(buf) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod cluster; | ||
pub mod key; | ||
pub mod rpc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cargo run --release -- \ | ||
--api-port 10001 \ | ||
--http-port 11001 \ | ||
--https-port 12001 \ | ||
--connector-port 0.0.0.0:13001 \ | ||
--root-domain local.ha.8xff.io \ | ||
--sdn-node-id 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cargo run --release -- \ | ||
--api-port 10002 \ | ||
--http-port 11002 \ | ||
--https-port 12002 \ | ||
--connector-port 0.0.0.0:13002 \ | ||
--root-domain local.ha.8xff.io \ | ||
--sdn-node-id 2 \ | ||
--sdn-seeds '1@/ip4/192.168.1.39/udp/50001' |
Oops, something went wrong.