Skip to content

Conversation

@cnlangzi
Copy link
Owner

@cnlangzi cnlangzi commented Oct 22, 2025

Summary by Sourcery

Switch gRPC MultiMode on for VLESS and VMess clients and update the xray-core dependency to address a memory leak in gRPC client connections.

Bug Fixes:

  • Enable MultiMode in gRPC settings for VLESS to prevent memory leaks
  • Enable MultiMode in gRPC settings for VMess to prevent memory leaks

Build:

  • Replace xray-core dependency with GitHub fork v0.0.2

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 22, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR addresses a memory leak in gRPC client connections by replacing the Xray-core module with a patched version and enabling MultiMode for all gRPC stream settings.

Entity relationship diagram for Xray-core module replacement

erDiagram
    "github.com/xtls/xray-core" ||--o| "github.com/cnlangzi/Xray-core" : replaces
    "github.com/cnlangzi/Xray-core" {
        string version
    }
Loading

Class diagram for updated GRPCSettings usage in stream settings

classDiagram
    class GRPCSettings {
        +string ServiceName
        +bool MultiMode
    }
    class StreamSettings {
        +GRPCSettings* GRPCSettings
        +HTTPSettings* HTTPSettings
    }
    class VlessURL
    class VlessToXRay
    VlessToXRay --> VlessURL
    VlessToXRay --> StreamSettings
    StreamSettings --> GRPCSettings
    class VmessConfig {
        +string Path
    }
    class configureGRPC
    configureGRPC --> StreamSettings
    configureGRPC --> VmessConfig
    StreamSettings --> GRPCSettings

    %% Highlight MultiMode change
    GRPCSettings : MultiMode = true (was false)
Loading

File-Level Changes

Change Details Files
Patch Xray-core dependency to new version to include memory leak fixes
  • Add replace directive in go.mod
  • Point github.com/xtls/xray-core to cnlangzi/Xray-core v0.0.2
go.mod
go.sum
Enable MultiMode in gRPC settings for VLESS
  • Change MultiMode from false to true in VlessToXRay
xray/vless.go
Enable MultiMode in gRPC settings for VMess
  • Change MultiMode from false to true in configureGRPC
xray/vmess.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 8.14%. Comparing base (f4018d8) to head (ffe3779).

Files with missing lines Patch % Lines
xray/vless.go 0.00% 1 Missing ⚠️
xray/vmess.go 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@          Coverage Diff          @@
##            main     #57   +/-   ##
=====================================
  Coverage   8.14%   8.14%           
=====================================
  Files         27      27           
  Lines       2124    2124           
=====================================
  Hits         173     173           
  Misses      1937    1937           
  Partials      14      14           
Flag Coverage Δ
Tests 8.14% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cnlangzi cnlangzi merged commit e09c785 into main Oct 22, 2025
5 checks passed
@cnlangzi cnlangzi deleted the fix/grpc_leak branch October 22, 2025 09:22
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.

3 participants