Skip to content

Commit

Permalink
Experiment: seed ignore buffer and send 1st fake packet instantly
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan6665 committed Sep 4, 2024
1 parent a8f0c9f commit 72cc99d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion proxy/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ func(s *Scheduler) mainLoop() {
errors.LogDebug(s.ctx, "Scheduler Trigger for fake buffer with ", d, " ", trigger)
mb := make(buf.MultiBuffer, 1)
s.Error <- s.writer.WriteMultiBuffer(mb)
if buffered, ok := s.writer.(*buf.BufferedWriter); ok {
buffered.SetBuffered(false)
}
}
s.bufferReadLock.Unlock()
}()
Expand All @@ -72,7 +75,7 @@ func(s *Scheduler) mainLoop() {

func(s *Scheduler) exampleIndependentScheduler() {
for {
time.Sleep(500 * time.Millisecond)
s.Trigger <- 1 // send fake buffer if no pending
time.Sleep(500 * time.Millisecond)
}
}
10 changes: 5 additions & 5 deletions proxy/vless/encoding/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ func PopulateSeed(seed string, addons *proxy.Addons) {
LongMin: 900,
LongMax: 1400,
}
addons.Delay = &proxy.DelayConfig{
IsRandom: true,
MinMillis: 100,
MaxMillis: 500,
}
// addons.Delay = &proxy.DelayConfig{
// IsRandom: true,
// MinMillis: 100,
// MaxMillis: 500,
// }
addons.Scheduler = &proxy.SchedulerConfig{
TimeoutMillis: 600,
}
Expand Down

0 comments on commit 72cc99d

Please sign in to comment.