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: add keep alive request duration to configs #962
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand this correctly, TCP_KEEPINTVL is a TCP specific option. You should not set it without checking the type of the socket.
You can either change the code, let me to fix this and merge, or justify your design.
You're right. I'll try to find a more general approach for setting the keep-alive duration. |
I will make necessary modification and merge it. |
Is this modification only for Linux sockets, not for other OS? |
how we should set it in configs ? |
Only for Linux. |
|
Does not seem to be fixed in v2fly v4.41.1. Test 1:
Result: 15 second keep-alive from v2fly to socks client (1080 → client source port) Adding |
This change is for |
This commit changes the wrong parameter.
Go sets both TCP_KEEPINTVL and TCP_KEEPIDLE to 15. Leaving TCP_KEEPINTVL to 15 looks fine to me (Linux default is 75). TCP_KEEPCNT is not changed and kept to standard 9, so 15*9 = 135 seconds before connection teardown, after TCP_KEEPIDLE had an effect. |
Trying to solve this.