z3phyr

Results 26 comments of z3phyr

可以把ipv4映射成ipv6地址,但是可能有些操作系统不支持双栈,是否要为ipv4再申请一个socket?

> > 可以把ipv4映射成ipv6地址,但是可能有些操作系统不支持双栈,是否要为ipv4再申请一个socket? > > 我建议根据需要转发的地址创建两个socket。 shadowsocks-rust [也是这么干的](https://docs.rs/shadowsocks-service/1.14.3/src/shadowsocks_service/server/udprelay.rs.html#356-373) 我个人觉得可以再加个编译时判断(如果不怕麻烦的话..),毕竟linux/bsd/windows都支持dual stack,而且绝大多数情况下服务端系统都是linux ```rust struct DualUdpSocket { v6: UdpSocket, #[cfg(not(any(unix,windows)))] v4: UdpSocket } ```

一般情况下,建议用native模式。使用udp的应用通常会允许丢包,比如短时间内发送几个小包,以最先到达的为准,剩下的可以忽略,没必要重传。 对于重要的数据包,应用通常也有自己的重传机制。

> > 一般情况下,建议用native模式。使用udp的应用通常会允许丢包,比如短时间内发送几个小包,以最先到达的为准,剩下的可以忽略,没必要重传。 对于重要的数据包,应用通常也有自己的重传机制。 > > 如果 udp + overhead 包大于 MAX_DATAGRAM_FRAME_SIZE,比如 http3 的应用,native 模式则无法使用, 即使 http3 有重传机制也没用。 目前确实是这样,需要等待 #61 解决

如果分片的话需要修改协议,工作量还是不少的

Seems the package is private and not visible to the public. Let's wait for @zhboner to properly configure it.

![Screenshot from 2022-05-12 00-56-09](https://user-images.githubusercontent.com/51367850/167894504-b5d3b846-483f-4e87-a0f9-2473d7cd8141.png)

Add `host` header could solve the problem. I'm considering to introduce a new option to make it possible for users to customize http headers.

I'm not sure if there is a performance issue when relaying multiple connections. Theoretically each connection is relayed separately, and there is no conflict between connections. With rust's concurrent model,...