Skip to content

Commit 039d3fe

Browse files
authored
Merge pull request #27 from tinydancer-io/custom_ws
fix: support custom websocket rpc
2 parents f6f5ec8 + 75f4fdb commit 039d3fe

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tinydancer/src/macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ macro_rules! convert_to_websocket {
33
($test:expr) => {
44
if $test.contains("https") {
55
$test.replace("https://", "wss://")
6+
} else if $test.contains("http") {
7+
$test.replace("http://", "ws://")
68
} else {
79
String::from("ws://0.0.0.0:8900")
810
}

tinydancer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ pub fn get_endpoint(cluster: String) -> String {
318318
"Mainnet" => "https://api.mainnet-beta.solana.com".to_owned(),
319319
"Devnet" => "https://api.devnet.solana.com".to_owned(),
320320
"Localnet" => "http://0.0.0.0:8899".to_owned(),
321-
_ => "http://0.0.0.0:8899".to_owned(),
321+
_ => cluster.to_owned(),
322322
}
323323
}
324324

0 commit comments

Comments
 (0)