Repository navigation
Conversation
…rough Since 5745dea the workers' common.Interrupt(link.Writer) reaches a MutexWriter, which embeds only buf.Writer, and does nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Let VLESS own the configured Mux and XUDP pools and feed Mux frames through the VLESS codecs without the carrier pipe bridge. Keep legacy factories for other outbounds and preserve the existing logical link handoff. Close the carrier independently of frame writes and retire the pools and preconnections with their handler. Preserve first-flight processing and final bytes returned with a terminal read error.
Abort an XDrive transport independently of a blocked frame writer while preserving graceful EOF for an idle carrier. Cancel the owned storage session and announcement, reject writes that reach admission after cancellation, and keep graceful WAL drain behavior for live sessions. Exercise a full unacknowledged slot ring through the direct VLESS Mux handler, idle peer EOF, slot and WAL admission, and cancellation of a pending announcement.
|
没什么必要继续穿透封装 这里不会有多大开销的 |
|
@svlavr rebase main #7355 (comment) 的意思是把 Mux 的代码移到 其它出站不给开 mux.cool 了,入站的话就 VMess 留一个兼容吧,且等新 Mux 稳定后出站不需要 |
|
This is a draft, still under development. I reworked it around your clarification: move Mux into VLESS and remove the old generic connection path. Mux now lives in On the transmit side, frames go directly through the VLESS codec. The receive side retains one existing I compared several alternatives:
The bounded writes follow your concern in #7345. The receive buffer addresses the separate read/parse overlap measured above. Direct writes also require an interruptible XDrive connection, so stopping Mux can unblock a write waiting on a full ring. A quiescent connection still closes with EOF. VLESS now closes its owned Mux pools and cancels unfinished connection creation during shutdown. The original receive-buffer thresholds are retained: 64 KiB for ordinary Mux and 16 KiB for Reverse. I compared both updated endpoints with main
Single-stream results varied substantially. These local measurements do not establish a speedup for every workload or transport. The fixes from #7359 and #7375 are preserved. Ordinary transports default to concurrency 8 and keep explicit positive values. XDrive retains the minimum of 128. XUDP settings are unchanged. Retirement of The full PR diff against main This is the first working version. I am still working on it. Comments, suggestions, |
|
@svlavr 原有的 mux 文件夹全删了,outbound 不要新开一个文件,直接改新 mux 文件夹,reverse 调用 mux 的方式也改 |
|
一步到位再弄个 |
|
类似 reverse,配置方式是 |
|
Updated the draft following your latest comments. Removed Added Direct writes and one receive pipe are retained. The fixes from #7359 and #7375 are preserved. I am continuing to optimize the implementation and compare alternatives. |
|
|
|
I am continuing to simplify the draft. In commit 2abab46, I included a small reduction that preserves the existing functionality, after comparing several ways to remove pipes and change how Link is used. I removed the unused response buffer from the Reverse control session. It was created for replies, but nobody read from it. Incoming data on that side is now released through I also removed duplicate Bridge and Portal initialization. The shared constructors are now Five unreachable lines following the error for the removed This commit touches 10 functions and one struct field:
In a separate construction/close measurement, the Reverse control worker went from 89 to 78 allocations, with allocated bytes falling from approximately 13,647 to 13,032 bytes per operation. This measures control-worker construction and cleanup. Alternatives compared:
For now, direct transmission and one receive pipe remain. The other buffers have separate responsibilities, including backpressure, session termination and XUDP reassociation. This commit: 6 files, +16/-40, net -24 lines. The full PR against main This remains a draft, and I am continuing to work on it. Comments, suggestions, |
|
|
|
This is the first working version for review, updated in Mux now lives in Client and server share frame parsing and connection lifecycle code. The old generic Mux connection machinery and duplicate shutdown paths are removed. Ordinary child responses go through One receive pipe remains on each outgoing carrier so transport reads can proceed independently of frame parsing and delivery. The original thresholds remain: 64 KiB for ordinary connections and 16 KiB for Reverse. XUDP retains its own association queues for reconnection; the old binding stops reading before the new binding takes over. No new server session-count or rate limit is introduced. Reverse no longer has duplicate initialization, the unused control-response buffer or a periodic collector for completed Portal handlers. Closing a handler removes that exact handler. Heartbeats and reconnection are retained. Close and interruption now pass through the reader and UDP destination-override wrappers. Native timeout-capable readers use their existing timeout mechanism without an extra reader goroutine. Canceling a blocked XDrive write unblocks it; normal shutdown of an idle connection retains EOF. Incoming VMess Mux compatibility is retained. The existing VMess UDP-cone path through Local Windows loopback measurements used both matching endpoints, six paired runs per workload, and byte-verified echo traffic. The single-stream workload transferred 512 MiB; the mixed workload transferred 1 GiB across eight bulk streams, with a small request/response stream sharing the carrier. Medians were:
Non-generated production Go code against upstream Comments, suggestions, |
|
I’m working on removing the remaining |
vmess出都要删? 这是vmess的东西的东西啊甚至有mux的协议指令 |
#4231 (comment) 本来就不会是原版 mux 了, 真要继续支持的话无非是加个调用加些参数的事,但有什么必要,一年前 Reverse 只留 VLESS 了也没人说还要给 VMess 留着 |
|
如果真是一个全新东西那break都炸 如果兼容老的那么本质还是一样的 |
|
我先合了 #5143 就是想看一下,现在 proxy/vmess/inbound/inbound.go 明显写复杂了吧,另外 reverse_test.go 直接删掉即可 |
|
|
|
@RPRX, I'm working on exactly that now. I'm simplifying VMess inbound and testing the changes. |
|
|
|
#4231 (comment) VMess 出站兼容原配置位置的 Mux,调用 VLESS 内的 multiplex 代码 |
…fter local session termination; Fix race (#7411) XTLS/Xray-core#4621 (comment) XTLS/Xray-core#7411 (comment) XTLS/Xray-core#7364 (comment) --------- Co-authored-by: Meow <197331664+Meo597@users.noreply.github.com> (cherry picked from commit b1905088c3195992c345dfd35d2fbef515c3bd49) Co-authored-by: Mishalski <100153948+wywywywycloud@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
if request.Command == protocol.RequestCommandMux {
worker := multiplex.NewServerWorker(ctx, dispatch.DispatchLink, &transport.Link{Reader: clientReader, Writer: clientWriter})
<-worker.WaitClosed()
return nil
}
|
Complete the outer TLS handshake before checking the negotiated Vision version. Reuse the decoded inbound Link and select SingleXUDP without a synthetic destination. Use one condition variable to notify carrier work and capacity.
|
@RPRX, I finished the cleanup and pushed the changes. I removed another 28 lines from VMess inbound. Ordinary TCP and UDP use the VMess outbound accepts All 11 protocol scenarios, interoperability checks with the earlier build, and targeted Multiplex tests with the race detector passed. The full PR is now 403 lines smaller than |
|
|
Use the upstream first-write response framing, keep serialization for ordinary TCP and UDP replies, and rely on the shared Multiplex worker for Mux. Restore the upstream VMess Mux scenarios.
Keep physical write serialization on the carrier, share endpoint framing, and consolidate VLESS outbound setup. Reuse VMess body codec initialization in each direction and remove redundant outbound handling.
Check VMess body codecs in both directions, verify actual Mux carrier reuse and user removal, and exercise Vision over mKCP. Simplify VMess email indexing and request selection, and remove unused VLESS handler state.
|
|
Use the decoded and encoded endpoints directly for native Multiplex. Keep the ordinary post-read cancellation guard while removing duplicate writer and socket lifecycle handling. Restore upstream test fixtures outside the migration.
|
@RPRX, I made the If you'd prefer to keep |
|
你想弄的话弄成独立的 PR 吧,我还是更关心 codecBody 那块代码能不能去掉 |
Keep codec factoring out of the Multiplex migration. Restore the four encoding files from the upstream base, including the original tests.
Pass the decoded reader directly to DispatchLink for ordinary VMess, matching upstream. Native Freedom closes the backend on cancellation in the tested cases. The direct Multiplex path already bypassed the wrapper.
Keep the Mux carrier counter with the affected tests. Name both XDrive configuration keys in the diagnostic and restore the original upstream fixtures.
Restore deferred dispatcher registration and retain legacy VLESS Mux settings across API replay. Cancel Reverse without waiting under the outbound manager lock. Make the UDP/443 test detect unexpected carrier opens and drop redundant XUDP cleanup.
Select native Multiplex explicitly and drop redundant mode and response codec checks. Preserve retry, stream termination and physical connection ownership.
Changes and checks
The DNS Please take a look. I think everything is ready. |
|
|
|
@RPRX, you suggested simplifying the VMess code. I replaced Got it. I'll restore the original implementation and keep the changes in this PR to a minimum. |
|
@svlavr |
Move multiplexing to
proxy/vless/multiplexand Reverse toproxy/vless/reverse. VLESS inbound, outbound and Reverse use direct transport paths. Intermediate pipes are removed from all VLESS Multiplex and Reverse paths and from the VMess Multiplex inbound adapter.Configure VLESS outbound through
settings.multiplex. The old generic outbound Mux and classic Reverse paths are removed.Preserve incremental TCP delivery, whole UDP packets and XUDP reconnection. Simplify shutdown and VMess response startup, and retain actual framing and transport errors.
First working version for review.