Skip to content

Commit

Permalink
Bumped up batch size and log connection time
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Nov 5, 2024
1 parent 8b9cead commit 7cfdd7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fronted.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func Vet(m *Masquerade, pool *x509.CertPool, testURL string) bool {
// user who does not have proxies cached on disk.
func (f *fronted) findWorkingMasquerades(listener func(f *fronted)) {
// vet masquerades in batches
const batchSize int = 25
const batchSize int = 40
var successful atomic.Uint32

// We loop through all of them until we have 4 successful ones.
Expand Down Expand Up @@ -374,6 +374,10 @@ func (f *fronted) doDial(m MasqueradeInterface) (conn net.Conn, retriable bool,
op.Set("masquerade_ip", m.getIpAddress())
op.Set("masquerade_provider", m.getProviderID())

// Log the time it takes to dial
defer func(start time.Time) {
log.Debugf("Dialing to %v took %v", m, time.Since(start))
}(time.Now())
conn, err = m.dial(f.certPool, f.clientHelloID)
if err != nil {
if !isNetworkUnreachable(err) {
Expand Down

0 comments on commit 7cfdd7c

Please sign in to comment.