Benign crates 2,060,217 installs Download

rama-socks5 0.3.0-rc1

“SOCKS5 support for rama”

Contains an unbounded block loopArchive ships a root-level test tree
SHA-2565216d99e323cbfe73e3547f453c68fed9db900ec29e323042cb5ec65f3d814e4

Evidence

imports std::net::IpAddr lines 1–25
1use std::io::ErrorKind;
2
3use rama_core::bytes::{Bytes, BytesMut};
4use rama_core::error::{BoxError, ErrorExt};
5use rama_core::telemetry::tracing;
6use rama_net::address::{HostWithPort, SocketAddress};
7
8use rama_udp::UdpSocket;
9
10#[cfg(feature = "dns")]
11use super::MaybeDnsResolver;
12use crate::proto::udp::UdpHeader;
13
14#[cfg(feature = "dns")]
15use ::{
16 rama_core::{error::ErrorContext, extensions::Extensions},
17 rama_net::mode::DnsResolveIpMode,
18};
19
20use std::net::IpAddr;
21
22#[derive(Debug)]
23pub(super) struct UdpSocketRelay {
24 client_address: SocketAddress,
25 pinned_client_address: Option<Sock …
References the Tokio async runtime namespace lines 133–138
133:6… self.south_read_buf.resize(self.south_max_size, 0);
134
135 tokio::select! {
136 result = self.north.recv_from(&mut self.north_read_buf[..]) => {
137 match result {
138 …
imports super::* lines 541–550
541:40… ot be resolved: rama-socks5 dns feature is disabled"))
542 }
543}
544
545#[cfg(test)]
546mod tests {
547 use super::*;
548
549 // Regression for Bug 2: send_to_north(None) was calling BytesMut::resize() after
550 // tru …
Rust UdpSocket::bind call lines 554–557
554:24… t receives north-bound packets
555 let client = tokio::net::UdpSocket::bind("127.0.0.1:0").await.unwrap();
556 let client_addr: std::net::SocketAddr = client.local_addr().unwrap();
557 let client_ …
Rust sends a datagram to a destination lines 566–577
566:64… o();
567
568 let payload = b"regression bug2 payload";
569 server.send_to(payload, south_addr).await.unwrap();
570
571 let mut relay = UdpSocketRelay::new(client_socket_addr, north, 4096, south, 4096);
572
573 // recv() reads south packet and stores raw payload in south_read_buf
574 let state = relay.recv().await.unwrap().unwrap();
575 assert!(
576 matches!(state, UdpRelayState::ReadSouth(addr) if addr == server_socket_addr),
577 …

Showing the top 5 files — 1 more file (26 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.