fix: add set_reuse_address to prevent bind error
When the client restarts, some socks clients' connections stay in the `FIN-WAIT` state. Which prevents the client from going up again immediately.
This commit is contained in:
parent
0303155b28
commit
f5834b47c4
@ -38,6 +38,7 @@ impl Socks5 {
|
||||
} else {
|
||||
let socket = Socket::new(Domain::IPV6, Type::STREAM, Some(Protocol::TCP))?;
|
||||
socket.set_only_v6(false)?;
|
||||
socket.set_reuse_address(true)?;
|
||||
socket.bind(&SockAddr::from(local_addr))?;
|
||||
socket.listen(128)?;
|
||||
TcpListener::from_std(StdTcpListener::from(socket))?
|
||||
|
Loading…
x
Reference in New Issue
Block a user