File tree 4 files changed +20
-2
lines changed
4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -379,13 +379,15 @@ class WsStreamSettings extends XrayCommonClass {
379
379
acceptProxyProtocol = false ,
380
380
path = '/' ,
381
381
host = '' ,
382
- headers = [ ]
382
+ headers = [ ] ,
383
+ heartbeatPeriod = 0 ,
383
384
) {
384
385
super ( ) ;
385
386
this . acceptProxyProtocol = acceptProxyProtocol ;
386
387
this . path = path ;
387
388
this . host = host ;
388
389
this . headers = headers ;
390
+ this . heartbeatPeriod = heartbeatPeriod ;
389
391
}
390
392
391
393
addHeader ( name , value ) {
@@ -402,6 +404,7 @@ class WsStreamSettings extends XrayCommonClass {
402
404
json . path ,
403
405
json . host ,
404
406
XrayCommonClass . toHeaders ( json . headers ) ,
407
+ json . heartbeatPeriod ,
405
408
) ;
406
409
}
407
410
@@ -411,6 +414,7 @@ class WsStreamSettings extends XrayCommonClass {
411
414
path : this . path ,
412
415
host : this . host ,
413
416
headers : XrayCommonClass . toV2Headers ( this . headers , false ) ,
417
+ heartbeatPeriod : this . heartbeatPeriod ,
414
418
} ;
415
419
}
416
420
}
Original file line number Diff line number Diff line change @@ -206,23 +206,31 @@ class KcpStreamSettings extends CommonClass {
206
206
}
207
207
208
208
class WsStreamSettings extends CommonClass {
209
- constructor ( path = '/' , host = '' ) {
209
+ constructor (
210
+ path = '/' ,
211
+ host = '' ,
212
+ heartbeatPeriod = 0 ,
213
+
214
+ ) {
210
215
super ( ) ;
211
216
this . path = path ;
212
217
this . host = host ;
218
+ this . heartbeatPeriod = heartbeatPeriod ;
213
219
}
214
220
215
221
static fromJson ( json = { } ) {
216
222
return new WsStreamSettings (
217
223
json . path ,
218
224
json . host ,
225
+ json . heartbeatPeriod ,
219
226
) ;
220
227
}
221
228
222
229
toJson ( ) {
223
230
return {
224
231
path : this . path ,
225
232
host : this . host ,
233
+ heartbeatPeriod : this . heartbeatPeriod
226
234
} ;
227
235
}
228
236
}
Original file line number Diff line number Diff line change 337
337
< a-form-item label ='{{ i18n "path" }} '>
338
338
< a-input v-model.trim ="outbound.stream.ws.path "> </ a-input >
339
339
</ a-form-item >
340
+ < a-form-item label ='Heartbeat Period '>
341
+ < a-input-number v-model.number ="outbound.stream.ws.heartbeatPeriod " :min ="0 "> </ a-input-number >
342
+ </ a-form-item >
340
343
</ template >
341
344
342
345
<!-- http -->
Original file line number Diff line number Diff line change 9
9
< a-form-item label ='{{ i18n "path" }} '>
10
10
< a-input v-model.trim ="inbound.stream.ws.path "> </ a-input >
11
11
</ a-form-item >
12
+ < a-form-item label ='Heartbeat Period '>
13
+ < a-input-number v-model.number ="inbound.stream.ws.heartbeatPeriod " :min ="0 "> </ a-input-number >
14
+ </ a-form-item >
12
15
< a-form-item label ='{{ i18n "pages.inbounds.stream.tcp.requestHeader" }} '>
13
16
< a-button icon ="plus " size ="small " @click ="inbound.stream.ws.addHeader('host', '') "> </ a-button >
14
17
</ a-form-item >
You can’t perform that action at this time.
0 commit comments