You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Surge ${proxy.type} proxy ${proxy.name}: max-streams=${maxStreams} is greater than 3. Too many streams sharing one TCP connection may hurt performance.`,
79
+
);
80
+
}
81
+
71
82
exportdefaultfunctionSurge_Producer(){
72
83
constproduce=(proxy,type,opts={})=>{
73
84
if(
@@ -434,6 +445,11 @@ function trusttunnel(proxy) {
Copy file name to clipboardExpand all lines: backend/src/test/proxy-producers/text.spec.js
+93Lines changed: 93 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -545,6 +545,99 @@ describe('Proxy text producers', function () {
545
545
]);
546
546
});
547
547
548
+
it('produces Surge max-streams for HTTP/2 CONNECT and TrustTunnel',function(){
549
+
constoutput=ProxyUtils.produce(
550
+
[
551
+
{
552
+
type: 'h2-connect',
553
+
name: 'Surge H2 Max Streams',
554
+
server: 'h2.example.com',
555
+
port: 443,
556
+
tls: true,
557
+
sni: 'sni.example.com',
558
+
headers: {
559
+
'X-Padding': '<random-string(16-32)>',
560
+
},
561
+
'max-streams': 1,
562
+
},
563
+
{
564
+
type: 'trusttunnel',
565
+
name: 'Surge Trust Max Streams',
566
+
server: 'trust.example.com',
567
+
port: 443,
568
+
username: 'user',
569
+
password: 'pass',
570
+
headers: {
571
+
'X-Client': 'Surge',
572
+
},
573
+
'max-streams': 3,
574
+
sni: 'sni.example.com',
575
+
},
576
+
],
577
+
'Surge',
578
+
'external',
579
+
);
580
+
581
+
expect(output.split('\n')).to.deep.equal([
582
+
'Surge H2 Max Streams=h2-connect,h2.example.com,443,headers="X-Padding:"<random-string(16-32)>"",max-streams=1,sni="sni.example.com"',
583
+
'Surge Trust Max Streams=trust-tunnel,trust.example.com,443,username="user",password="pass",headers="X-Client:"Surge"",max-streams=3,sni="sni.example.com"',
584
+
]);
585
+
});
586
+
587
+
it('warns when Surge max-streams is greater than 3',function(){
0 commit comments