@@ -82,15 +82,15 @@ func NewClient(cloudflareHost string, destPort int, scheme string, destAddr stri
82
82
debug : debug ,
83
83
maxBodySize : 10 * 1024 * 1024 ,
84
84
rateLimiter : rate .NewLimiter (rate .Every (time .Millisecond * 100 ), 1000 ),
85
- readBufferSize : 64 * 1024 , // Increase to 64KB
86
- writeBufferSize : 64 * 1024 , // Increase to 64KB
87
- pollInterval : 25 * time .Millisecond , // Decrease from 50ms to 25ms
85
+ readBufferSize : 32 * 1024 ,
86
+ writeBufferSize : 32 * 1024 ,
87
+ pollInterval : 50 * time .Millisecond ,
88
+ batchSize : 32 * 1024 ,
88
89
bufferPool : sync.Pool {
89
90
New : func () interface {} {
90
91
return make ([]byte , 64 * 1024 ) // Increase to 64KB
91
92
},
92
93
},
93
- batchSize : 64 * 1024 , // 64KB batch size
94
94
}
95
95
96
96
// Load system root CAs
@@ -110,29 +110,26 @@ func NewClient(cloudflareHost string, destPort int, scheme string, destAddr stri
110
110
CurvePreferences : []tls.CurveID {
111
111
tls .X25519 ,
112
112
tls .CurveP256 ,
113
- tls .CurveP384 ,
114
113
},
115
114
CipherSuites : []uint16 {
116
115
tls .TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
117
116
tls .TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ,
118
- tls .TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
119
- tls .TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,
120
- tls .TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ,
121
- tls .TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 ,
122
117
},
123
- PreferServerCipherSuites : false ,
118
+ PreferServerCipherSuites : true ,
124
119
SessionTicketsDisabled : false ,
125
120
InsecureSkipVerify : false ,
126
- NextProtos : []string {"http/1.1" }, // Force HTTP/1.1
121
+ NextProtos : []string {"http/1.1" },
127
122
},
128
- MaxIdleConns : 100 ,
129
- IdleConnTimeout : 90 * time .Second ,
130
- DisableCompression : true ,
131
- ForceAttemptHTTP2 : false , // Disable HTTP/2
132
- MaxIdleConnsPerHost : 100 ,
133
- MaxConnsPerHost : 100 ,
134
- WriteBufferSize : 64 * 1024 ,
135
- ReadBufferSize : 64 * 1024 ,
123
+ MaxIdleConns : 1 ,
124
+ IdleConnTimeout : 90 * time .Second ,
125
+ DisableCompression : true ,
126
+ ForceAttemptHTTP2 : false ,
127
+ MaxIdleConnsPerHost : 1 ,
128
+ MaxConnsPerHost : 1 ,
129
+ WriteBufferSize : 32 * 1024 ,
130
+ ReadBufferSize : 32 * 1024 ,
131
+ ResponseHeaderTimeout : 30 * time .Second ,
132
+ ExpectContinueTimeout : 1 * time .Second ,
136
133
}
137
134
138
135
client .httpClient = & http.Client {
0 commit comments