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

Add stats counter for outbounds #38

Merged
merged 3 commits into from
Jun 28, 2020
Merged

Add stats counter for outbounds #38

merged 3 commits into from
Jun 28, 2020

Conversation

yuhan6665
Copy link
Contributor

@yuhan6665 yuhan6665 commented Jun 27, 2020

V2ray has a great design to create both client and server from one project. However, the current traffic stats can only be measured from the inbounds. This is ok for server but not very useful for the client. On the client side, user want to know how much traffic went through freedom, how much went through proxy, and which node.
Currently it only works for TCP. I think it cover most of the use case. Once approved I will work to add UDP support.
It works for TCP as well as UDP. I've tested this code for measuring vmess (tcp, wss, mkcp) and freedom outbound.

I'm new to this project. I'm a contributor for v2rayNG. Please kindly review my code :)

The fields will be used by Outbounds as well in the next commit
@kslr kslr requested review from vcptr and xiaokangwang June 27, 2020 12:19
Copy link
Contributor

@vcptr vcptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you.

@yuhan6665
Copy link
Contributor Author

Thanks for your review! I added a line of comment based on Codacy review. Not sure about the other test failures. But I checked the test I added is running successfully.

Copy link
Contributor

@xiaokangwang xiaokangwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this pr is ready to be merged. Thanks for your work.

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.

4 participants