Skip to content

Commit

Permalink
Merge pull request #27 from tinydancer-io/custom_ws
Browse files Browse the repository at this point in the history
fix: support custom websocket rpc
  • Loading branch information
anoushk1234 authored Mar 30, 2023
2 parents f6f5ec8 + 75f4fdb commit 039d3fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tinydancer/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ macro_rules! convert_to_websocket {
($test:expr) => {
if $test.contains("https") {
$test.replace("https://", "wss://")
} else if $test.contains("http") {
$test.replace("http://", "ws://")
} else {
String::from("ws://0.0.0.0:8900")
}
Expand Down
2 changes: 1 addition & 1 deletion tinydancer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ pub fn get_endpoint(cluster: String) -> String {
"Mainnet" => "https://api.mainnet-beta.solana.com".to_owned(),
"Devnet" => "https://api.devnet.solana.com".to_owned(),
"Localnet" => "http://0.0.0.0:8899".to_owned(),
_ => "http://0.0.0.0:8899".to_owned(),
_ => cluster.to_owned(),
}
}

Expand Down

0 comments on commit 039d3fe

Please sign in to comment.