Repository navigation
XMC finalmask: Make startup paddings configurable (direction, length and delay) - #6769
Conversation
|
@Fangliding 你先看一下吧 |
|
Sounds interesting |
| if turn == nil || turn.LengthMin < 1 || turn.LengthMax < turn.LengthMin || turn.LengthMax > maxPaddingTurnLength { | ||
| return nil, fmt.Errorf("invalid padding length range at turn %d", i) | ||
| } | ||
| direction := paddingClientToServer |
There was a problem hiding this comment.
I think, that switch case better use for this business logic
| Password: password, RsaPrivateKey: privateKey, RsaPublicKey: publicKey, | ||
| Hostname: "localhost", Padding: padding, | ||
| Profiles: []*Profile{{ | ||
| Username: profile.Username, Uuid: profile.UUID[:], |
There was a problem hiding this comment.
| Username: profile.Username, Uuid: profile.UUID[:], | |
| Uuid: profile.UUID[:], |
Why are you using slice splice, I think, you shoud use copy for profile.UUID
There was a problem hiding this comment.
I don't think a copy is needed here ,uuid isnt modified later in this test
|
@spr334-a ready 了吗,给文档开个 PR |
|
所以这个 padding 是否符合“两端配置一样、对端有检查”?这是通过单/双来区分哪个端的?客户端不能连发两个 padding? |
|
@spr334-a Are you merging it? |
|
|
Add direction field to Padding protobuf message to allow users to specify whether each padding turn goes from client to server (1) or server to client (2). This removes the previous limitation where padding turns had to alternate directions. Changes: - Add direction field to Padding message in config.proto - Update config.go to read direction from config instead of alternating - Remove validation that prevented consecutive same-direction turns - Update all tests to specify direction explicitly - Add test case for consecutive same-direction padding
d23bf4d to
7eaa1dd
Compare
Sorry, the translation from Chinese to English is not very good, could ypu explain on English? |
Client need to support sending two or more padding at once before merging |
Do you make this? |
|
Or you want my features? |
Wdym? |
Rework your PR |
I committed the changes before you asked |
|
@RPRX Can we merge? |
|
@spr334-a 最好再支持一下加延迟吧,更新 PR 配置示例和 README,另外原先的默认 padding 参数改成基于新配置的缺省值 |
Parse direction field and use explicit object format.
e144fea to
50d8ed4
Compare
|
@spr334-a 数组一般加 s,所以叫 |
Per rprx's request: array fields use plural form, and add configurable delay in milliseconds after each turn.
|
@spr334-a 修一下 test |
|
@spr334-a |
|
@spr334-a rebase 并把 |
9938052 to
bb335c6
Compare
|
#7401 (comment) 然而刚发现这个 PR 还没开允许修改,只能合并后再 fmt 了,由于要 force-push,
|
paddings configurable (direction, length and delay)
…ngth` and `delay`) (#6769) #6487 (comment) #6769 (comment) #6769 (comment) #7394 (comment) #7401 (comment) #6769 (comment) --------- Co-authored-by: RPRX <[email protected]>
…ngth` and `delay`) (#6769) #6487 (comment) #6769 (comment) #6769 (comment) #7394 (comment) #7401 (comment) #6769 (comment) Closes #6732 (comment) --------- Co-authored-by: RPRX <[email protected]>
…ngth` and `delay`) (#6769) #6487 (comment) #6769 (comment) #6769 (comment) #7394 (comment) #7401 (comment) #6769 (comment) Closes #6732 (comment) --------- Co-authored-by: RPRX <[email protected]>
|
5d17b87 fmt 了,并把 xmc 文件夹下 README.md 和 *_test.go 删了, |
|
|
Sync with the squashed XTLS#6769 merge and keep the follow-up delay-range change. Follow the maintainer's cleanup of XTLS#6769 and drop the XMC README/*_test.go files it removed; the unrelated XMC tests deleted by that squash are not restored here. The XMC delay implementation, its validation, and the infra/conf delay parsing tests remain. Assisted-by: DeepSeek (AI)
…ports range (receiver waits at least minimal ms) (#7402) #6769 (comment) #7394 (comment) #6769 (comment) #7402 (comment) #7402 (comment) #7394 (comment)
…ports range (receiver waits at least minimal ms) (#7402) #6769 (comment) #7394 (comment) #6769 (comment) #7402 (comment) #7402 (comment) #7402 (comment) #7394 (comment) #7402 (comment)
Each entry specifies a fixed length or inclusive range, plus direction (
"c2s"for client-to-server or"s2c"for server-to-client; full names"client-to-server"and"server-to-client"are also accepted). Turns can be in any order and direction, including consecutive same-direction turns. Both endpoints need the same array. The first length includes Login Acknowledged's two bytes; invalid ranges and directions are rejected during config loading and connection setup.Omitting the
paddingfield entirely preserves the existing 26.1.2 preset. Custom turns have no intentional delays. Data framing, keep-alives, and mask ordering are unchanged. No new dependency or wire-format change.This deliberately leaves profile registries, version negotiation, and ongoing traffic scheduling for separate discussion. In particular, existing length checks are not a configuration-fingerprint handshake and do not detect every endpoint mismatch; the documentation calls this out.
Tests cover range validation, direction validation, prefix and VarInt boundaries, default-preset preservation, and encrypted bidirectional round trips with single, odd, and even turn counts.
Checked on Windows with Go 1.27.0:
go vet ./infra/confreports existing unreachable code atinfra/conf/xray.go:606, also reproduced on the base commit.