Skip to content

Commit ee1e18d

Browse files
authored
Schedulers -> Flow
1 parent 72d8d2a commit ee1e18d

File tree

9 files changed

+65
-66
lines changed

9 files changed

+65
-66
lines changed

infra/conf/vless.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) {
4848
return nil, newError(`VLESS clients: invalid user`).Base(err)
4949
}
5050

51-
if account.Schedulers != "" {
52-
return nil, newError(`VLESS clients: "schedulers" is not available in this version`)
51+
if account.Flow != "" {
52+
return nil, newError(`VLESS clients: "flow" is not available in this version`)
5353
}
5454
if account.Encryption != "" {
5555
return nil, newError(`VLESS clients: "encryption" should not in inbound settings`)
@@ -161,8 +161,8 @@ func (c *VLessOutboundConfig) Build() (proto.Message, error) {
161161
return nil, newError(`VLESS users: invalid user`).Base(err)
162162
}
163163

164-
if account.Schedulers != "" {
165-
return nil, newError(`VLESS users: "schedulers" is not available in this version`)
164+
if account.Flow != "" {
165+
return nil, newError(`VLESS users: "flow" is not available in this version`)
166166
}
167167
if account.Encryption != "none" {
168168
return nil, newError(`VLESS users: please add/set "encryption":"none" for every user`)

proxy/vless/account.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func (a *Account) AsAccount() (protocol.Account, error) {
1515
}
1616
return &MemoryAccount{
1717
ID: protocol.NewID(id),
18-
Schedulers: a.Schedulers, // needs parser here?
18+
Flow: a.Flow, // needs parser here?
1919
Encryption: a.Encryption, // needs parser here?
2020
}, nil
2121
}
@@ -24,8 +24,8 @@ func (a *Account) AsAccount() (protocol.Account, error) {
2424
type MemoryAccount struct {
2525
// ID of the account.
2626
ID *protocol.ID
27-
// Schedulers of the account.
28-
Schedulers string
27+
// Flow of the account. May be "xtls-rprx-origin".
28+
Flow string
2929
// Encryption of the account. Used for client connections, and only accepts "none" for now.
3030
Encryption string
3131
}

proxy/vless/account.pb.go

Lines changed: 15 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proxy/vless/account.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ option java_multiple_files = true;
99
message Account {
1010
// ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57".
1111
string id = 1;
12-
// Schedulers settings.
13-
string schedulers = 2;
12+
// Flow settings. May be "xtls-rprx-origin".
13+
string flow = 2;
1414
// Encryption settings. Only applies to client side, and only accepts "none" for now.
1515
string encryption = 3;
1616
}

proxy/vless/encoding/addons.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error {
1515

16-
switch addons.Scheduler {
16+
switch addons.Flow {
1717
default:
1818

1919
if err := buffer.WriteByte(0); err != nil {
@@ -47,7 +47,7 @@ func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error) {
4747
}
4848

4949
// Verification.
50-
switch addons.Scheduler {
50+
switch addons.Flow {
5151
default:
5252

5353
}
@@ -61,7 +61,7 @@ func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error) {
6161
// EncodeBodyAddons returns a Writer that auto-encrypt content written by caller.
6262
func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, addons *Addons) buf.Writer {
6363

64-
switch addons.Scheduler {
64+
switch addons.Flow {
6565
default:
6666

6767
return buf.NewWriter(writer)
@@ -73,7 +73,7 @@ func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, addons
7373
// DecodeBodyAddons returns a Reader from which caller can fetch decrypted body.
7474
func DecodeBodyAddons(reader io.Reader, request *protocol.RequestHeader, addons *Addons) buf.Reader {
7575

76-
switch addons.Scheduler {
76+
switch addons.Flow {
7777
default:
7878

7979
return buf.NewReader(reader)

proxy/vless/encoding/addons.pb.go

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proxy/vless/encoding/addons.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ option java_package = "com.v2ray.core.proxy.vless.encoding";
77
option java_multiple_files = true;
88

99
message Addons {
10-
string Scheduler = 1;
11-
bytes SchedulerV = 2;
10+
string Flow = 1;
11+
bytes Seed = 2;
1212
}

proxy/vless/inbound/inbound.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
417417
defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly)
418418

419419
responseAddons := &encoding.Addons{
420-
Scheduler: requestAddons.Scheduler,
420+
Flow: requestAddons.Flow,
421421
}
422422

423423
bufferWriter := buf.NewBufferedWriter(buf.NewWriter(connection))
@@ -448,7 +448,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
448448
}
449449

450450
// Indicates the end of response payload.
451-
switch responseAddons.Scheduler {
451+
switch responseAddons.Flow {
452452
default:
453453

454454
}

proxy/vless/outbound/outbound.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
105105
account := request.User.Account.(*vless.MemoryAccount)
106106

107107
requestAddons := &encoding.Addons{
108-
Scheduler: account.Schedulers,
108+
Flow: account.Flow,
109109
}
110110

111111
sessionPolicy := v.policyManager.ForLevel(request.User.Level)
@@ -140,7 +140,7 @@ func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
140140
}
141141

142142
// Indicates the end of request payload.
143-
switch requestAddons.Scheduler {
143+
switch requestAddons.Flow {
144144
default:
145145

146146
}

0 commit comments

Comments
 (0)