Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timeout issues #25

Merged
merged 8 commits into from
Mar 14, 2024
Merged

Fix timeout issues #25

merged 8 commits into from
Mar 14, 2024

Conversation

ssrlive
Copy link
Contributor

@ssrlive ssrlive commented Mar 10, 2024

No description provided.

@ssrlive
Copy link
Contributor Author

ssrlive commented Mar 10, 2024

But I find another issue: the TCP connection can NOT exit.

We can reproduce it with tun2proxy and rperf. Command line rperf -c my_rmt_svr -u -r.

image

@ssrlive
Copy link
Contributor Author

ssrlive commented Mar 10, 2024

After this commit 8f232ce , it seems fixed. but it is in timeout situation, not a good solution.

image

@SajjadPourali
Copy link
Collaborator

Placing the flags in a line before affects my readability. We can put them on the same line if you don't mind.

let flags = tcp_flags::RST | tcp_flags::ACK;
pkt_sender.send(stream.create_rev_packet(flags, TTL, None, Vec::new())?)

I cannot reproduce the timeout issue, and working with tun2socks entails some complexities for me. Is it possible to describe the issue using an example or a proof of concept (PoC)?

@ssrlive
Copy link
Contributor Author

ssrlive commented Mar 11, 2024

I think this can significantly reduce the number of lines of code, otherwise readability will be reduced for me.
how about add file rustfmt.toml with max_width = 140?

Placing the flags in a line before affects my readability.


testing steps for me:

  1. install and run rperf server on one VPS1:
cargo install rperf --git=https://github.com/ssrlive/rperf.git --branch=nat
rperf -s &
  1. install and run a SOCKS5 server on another VPS2:
cargo install socks5-impl --example s5-server
s5-server -l 0.0.0.0:1080 &
  1. install and run tun2proxy on local PC:
cargo install tun2proxy
sudo ~/.cargo/bin/tun2proxy -p socks5://vps2_addr:1080 -s -b vps2_addr -v trace
  1. open another terminal on local PC, intstall and run rperf client:
cargo install rperf --git=https://github.com/ssrlive/rperf.git --branch=nat
rperf -c vps1_addr -u -r

Watch the output of tun2proxy, we can find some issues.

@ssrlive
Copy link
Contributor Author

ssrlive commented Mar 11, 2024

now, it looks the issue fixed indeed.
And all the issues can closed.

image

@SajjadPourali SajjadPourali merged commit ba40e3d into narrowlink:main Mar 14, 2024
3 checks passed
@ssrlive
Copy link
Contributor Author

ssrlive commented Mar 15, 2024

Please publish a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants