New config file

This commit is contained in:
Meo597 2025-06-08 20:51:38 +08:00
parent 002da9a24b
commit 461526a265
6 changed files with 36 additions and 34 deletions

View file

@ -33,14 +33,14 @@ func (c *Config) GetREALITYConfig() *reality.Config {
KeyLogWriter: KeyLogWriterFromConfig(c),
}
if c.LimitFallbackUpload != nil {
config.LimitFbUploadRate = c.LimitFallbackUpload.BytesPerSec
config.LimitFbUploadBurst = c.LimitFallbackUpload.BurstBytesPerSec
config.LimitFbUploadAfter = c.LimitFallbackUpload.AfterBytes
config.LimitFallbackUpload.BytesPerSec = c.LimitFallbackUpload.BytesPerSec
config.LimitFallbackUpload.BurstBytesPerSec = c.LimitFallbackUpload.BurstBytesPerSec
config.LimitFallbackUpload.AfterBytes = c.LimitFallbackUpload.AfterBytes
}
if c.LimitFallbackDownload != nil {
config.LimitFbDownloadRate = c.LimitFallbackDownload.BytesPerSec
config.LimitFbDownloadBurst = c.LimitFallbackDownload.BurstBytesPerSec
config.LimitFbDownloadAfter = c.LimitFallbackDownload.AfterBytes
config.LimitFallbackDownload.BytesPerSec = c.LimitFallbackDownload.BytesPerSec
config.LimitFallbackDownload.BurstBytesPerSec = c.LimitFallbackDownload.BurstBytesPerSec
config.LimitFallbackDownload.AfterBytes = c.LimitFallbackDownload.AfterBytes
}
config.ServerNames = make(map[string]bool)
for _, serverName := range c.ServerNames {

View file

@ -214,9 +214,9 @@ type LimitFallback struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
BytesPerSec float64 `protobuf:"fixed64,1,opt,name=bytes_per_sec,json=bytesPerSec,proto3" json:"bytes_per_sec,omitempty"`
BurstBytesPerSec int64 `protobuf:"zigzag64,2,opt,name=burst_bytes_per_sec,json=burstBytesPerSec,proto3" json:"burst_bytes_per_sec,omitempty"`
AfterBytes int64 `protobuf:"zigzag64,3,opt,name=after_bytes,json=afterBytes,proto3" json:"after_bytes,omitempty"`
BytesPerSec uint64 `protobuf:"varint,1,opt,name=bytes_per_sec,json=bytesPerSec,proto3" json:"bytes_per_sec,omitempty"`
BurstBytesPerSec uint64 `protobuf:"varint,2,opt,name=burst_bytes_per_sec,json=burstBytesPerSec,proto3" json:"burst_bytes_per_sec,omitempty"`
AfterBytes uint64 `protobuf:"varint,3,opt,name=after_bytes,json=afterBytes,proto3" json:"after_bytes,omitempty"`
}
func (x *LimitFallback) Reset() {
@ -249,21 +249,21 @@ func (*LimitFallback) Descriptor() ([]byte, []int) {
return file_transport_internet_reality_config_proto_rawDescGZIP(), []int{1}
}
func (x *LimitFallback) GetBytesPerSec() float64 {
func (x *LimitFallback) GetBytesPerSec() uint64 {
if x != nil {
return x.BytesPerSec
}
return 0
}
func (x *LimitFallback) GetBurstBytesPerSec() int64 {
func (x *LimitFallback) GetBurstBytesPerSec() uint64 {
if x != nil {
return x.BurstBytesPerSec
}
return 0
}
func (x *LimitFallback) GetAfterBytes() int64 {
func (x *LimitFallback) GetAfterBytes() uint64 {
if x != nil {
return x.AfterBytes
}
@ -325,12 +325,12 @@ var file_transport_internet_reality_config_proto_rawDesc = []byte{
0x61, 0x63, 0x6b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x83, 0x01, 0x0a, 0x0d,
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x22, 0x0a,
0x0d, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x01,
0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65,
0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65,
0x63, 0x12, 0x2d, 0x0a, 0x13, 0x62, 0x75, 0x72, 0x73, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73,
0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x10,
0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10,
0x62, 0x75, 0x72, 0x73, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x63,
0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x66, 0x74, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18,
0x03, 0x20, 0x01, 0x28, 0x12, 0x52, 0x0a, 0x61, 0x66, 0x74, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65,
0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x61, 0x66, 0x74, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65,
0x73, 0x42, 0x7f, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72,
0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74,
0x2e, 0x72, 0x65, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68,

View file

@ -31,7 +31,7 @@ message Config {
}
message LimitFallback {
double bytes_per_sec = 1;
sint64 burst_bytes_per_sec = 2;
sint64 after_bytes = 3;
uint64 bytes_per_sec = 1;
uint64 burst_bytes_per_sec = 2;
uint64 after_bytes = 3;
}