mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Bumps [redis](https://github.com/redis-rs/redis-rs) from 0.23.3 to 0.24.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/redis-rs/redis-rs/releases">redis's releases</a>.</em></p> <blockquote> <h2>v0.24.0</h2> <h3>0.24.0 (2023-12-05)</h3> <h4>Features</h4> <ul> <li><strong>Breaking change</strong>: Support Mutual TLS (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/858">#858</a> <a href="https://github.com/sp-angel"><code>@sp-angel</code></a>)</li> <li>Implement <code>FromRedisValue</code> for <code>Box<[T]></code> and <code>Arc<[T]></code> (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/799">#799</a> <a href="https://github.com/JOT85"><code>@JOT85</code></a>)</li> <li>Sync Cluster: support multi-slot operations. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/967">#967</a>)</li> <li>Execute multi-node requests using try_request. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/919">#919</a>)</li> <li>Sorted set blocking commands (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/962">#962</a> <a href="https://github.com/gheorghitamutu"><code>@gheorghitamutu</code></a>)</li> <li>Allow passing routing information to cluster. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/899">#899</a>)</li> <li>Add <code>tcp_nodelay</code> feature (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/941">#941</a> <a href="https://github.com/PureWhiteWu"><code>@PureWhiteWu</code></a>)</li> <li>Add support for multi-shard commands. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/900">#900</a>)</li> </ul> <h4>Changes</h4> <ul> <li>Order in usage of ClusterParams. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/997">#997</a>)</li> <li><strong>Breaking change</strong>: Fix StreamId::contains_key signature (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/783">#783</a> <a href="https://github.com/Ayush1325"><code>@Ayush1325</code></a>)</li> <li><strong>Breaking change</strong>: Update Command expiration values to be an appropriate type (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/589">#589</a> <a href="https://github.com/joshleeb"><code>@joshleeb</code></a>)</li> <li><strong>Breaking change</strong>: Bump aHash to v0.8.6 (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/966">#966</a> <a href="https://github.com/aumetra"><code>@aumetra</code></a>)</li> <li>Fix features for <code>load_native_certs</code>. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/996">#996</a>)</li> <li>Revert redis-test versioning changes (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/993">#993</a>)</li> <li>Tests: Add retries to test cluster creation (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/994">#994</a>)</li> <li>Fix sync cluster behavior with transactions. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/983">#983</a>)</li> <li>Sync Pub/Sub - cache received pub/sub messages. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/910">#910</a>)</li> <li>Prefer routing to primary in a transaction. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/986">#986</a>)</li> <li>Accept iterator at <code>ClusterClient</code> initialization (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/987">#987</a> <a href="https://github.com/ruanpetterson"><code>@ruanpetterson</code></a>)</li> <li><strong>Breaking change</strong>: Change timeouts from usize and isize to f64 (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/988">#988</a> <a href="https://github.com/eythorhel19"><code>@eythorhel19</code></a>)</li> <li>Update minimal rust version to 1.6.5 (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/982">#982</a>)</li> <li>Disable JSON module tests for redis 6.2.4. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/980">#980</a>)</li> <li>Add connection string examples (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/976">#976</a> <a href="https://github.com/NuclearOreo"><code>@NuclearOreo</code></a>)</li> <li>Move response policy into multi-node routing. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/952">#952</a>)</li> <li>Added functions that allow tests to check version. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/963">#963</a>)</li> <li>Fix XREADGROUP command ordering as per Redis Docs, and compatibility with Upstash Redis (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/960">#960</a> <a href="https://github.com/prabhpreet"><code>@prabhpreet</code></a>)</li> <li>Optimize make_pipeline_results by pre-allocate memory (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/957">#957</a> <a href="https://github.com/PureWhiteWu"><code>@PureWhiteWu</code></a>)</li> <li>Run module tests sequentially. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/956">#956</a>)</li> <li>Log cluster creation output in tests. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/955">#955</a>)</li> <li>CI: Update and use better maintained github actions. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/954">#954</a>)</li> <li>Call CLIENT SETINFO on new connections. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/945">#945</a>)</li> <li>Deprecate functions that erroneously use <code>tokio</code> in their name. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/913">#913</a>)</li> <li>CI: Increase timeouts and use newer redis. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/949">#949</a>)</li> <li>Remove redis version from redis-test. (<a href="https://redirect.github.com/redis-rs/redis-rs/pull/943">#943</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="37ba5614c9"><code>37ba561</code></a> Release redis 0.24.0 / redis-test 0.3.0 (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/998">#998</a>)</li> <li><a href="bcc6e3ba59"><code>bcc6e3b</code></a> Order in usage of ClusterParams. (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/997">#997</a>)</li> <li><a href="db19291263"><code>db19291</code></a> Fix StreamId::contains_key signature (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/783">#783</a>)</li> <li><a href="413f4d947e"><code>413f4d9</code></a> Update Command expiration values to be an appropriate type (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/589">#589</a>)</li> <li><a href="f4f5344d2c"><code>f4f5344</code></a> Bump aHash to v0.8.6 (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/966">#966</a>)</li> <li><a href="439118e73e"><code>439118e</code></a> Fix features for <code>load_native_certs</code>. (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/996">#996</a>)</li> <li><a href="a26373b145"><code>a26373b</code></a> Revert redis-test versioning changes (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/993">#993</a>)</li> <li><a href="882ecf9c5d"><code>882ecf9</code></a> Tests: Add retries to test cluster creation (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/994">#994</a>)</li> <li><a href="d8a5ca95e5"><code>d8a5ca9</code></a> Release redis 0.23.4 / redis-test 0.2.4 (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/992">#992</a>)</li> <li><a href="a6df6e273c"><code>a6df6e2</code></a> Fix sync cluster behavior with transactions. (<a href="https://redirect.github.com/redis-rs/redis-rs/issues/983">#983</a>)</li> <li>Additional commits viewable in <a href="https://github.com/redis-rs/redis-rs/compare/redis-0.23.3...redis-0.24.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
54 lines
1.4 KiB
Rust
54 lines
1.4 KiB
Rust
use anyhow::Result;
|
|
use redis::AsyncCommands;
|
|
use std::net::SocketAddr;
|
|
use std::time::Duration;
|
|
use tokio::net::UdpSocket;
|
|
use webrtc::turn::Error;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
env_logger::init();
|
|
|
|
let socket = UdpSocket::bind("127.0.0.1:0").await?;
|
|
let listening_addr = socket.local_addr()?;
|
|
|
|
println!("Our listening address is {listening_addr}");
|
|
|
|
let redis_client = redis::Client::open("redis://localhost:6379")?;
|
|
let mut redis_connection = redis_client.get_async_connection().await?;
|
|
|
|
redis_connection
|
|
.rpush("gateway_addr", listening_addr.to_string())
|
|
.await?;
|
|
let relay_addr = redis_connection
|
|
.blpop::<_, (String, String)>("client_relay_addr", 10.0)
|
|
.await?
|
|
.1
|
|
.parse::<SocketAddr>()?;
|
|
|
|
println!("Client's relay address is {relay_addr}");
|
|
|
|
tokio::time::timeout(Duration::from_secs(5), ping_pong(socket, relay_addr)).await??;
|
|
|
|
Ok(())
|
|
}
|
|
|
|
async fn ping_pong(socket: UdpSocket, relay_addr: SocketAddr) -> Result<(), Error> {
|
|
for _ in 0..1000 {
|
|
let ping = rand::random::<[u8; 32]>();
|
|
|
|
socket.send_to(&ping, relay_addr).await?;
|
|
|
|
println!("Sent ping to client: {}", hex::encode(ping));
|
|
|
|
let mut pong = [0u8; 32];
|
|
socket.recv_from(&mut pong).await?;
|
|
|
|
println!("Received pong from client: {}", hex::encode(pong));
|
|
|
|
assert_eq!(ping, pong);
|
|
}
|
|
|
|
Ok(())
|
|
}
|