您能获取使用 Rust UDP 套接字发送到的域 UDP 数据吗?
我有一个看起来如下的小程序:
let sock = UdpSocket::bind("0.0.0.0:1024").unwrap();
let mut buf = [0; 10000];
loop {
let (len, src) = sock.recv_from(&mut buf).unwrap();
let buf = &mut buf[..len];
// do stuff
}
假设有人将数据发送到示例:1024
,是否有任何方法知道他们将数据发送到example.com
不仅是源IP地址?
I have a small program that looks like the following:
let sock = UdpSocket::bind("0.0.0.0:1024").unwrap();
let mut buf = [0; 10000];
loop {
let (len, src) = sock.recv_from(&mut buf).unwrap();
let buf = &mut buf[..len];
// do stuff
}
Let's say someone sends data to example.com:1024
, is there any way to know they sent the data to example.com
and not just the source IP address?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论