mirror of
				https://github.com/MHSanaei/3x-ui.git
				synced 2025-10-31 12:22:51 +00:00 
			
		
		
		
	XHTTP: server & client
Remove scMinPostsIntervalMs, xmux, noGRPCHeader from the server side and add them to the client side. Before you could have them on sub json but I decided to remove them.
This commit is contained in:
		
							parent
							
								
									f0f4f082ae
								
							
						
					
					
						commit
						0df85cc3d9
					
				
					 4 changed files with 52 additions and 52 deletions
				
			
		|  | @ -496,19 +496,9 @@ class xHTTPStreamSettings extends XrayCommonClass { | ||||||
|         headers = [], |         headers = [], | ||||||
|         scMaxBufferedPosts = 30, |         scMaxBufferedPosts = 30, | ||||||
|         scMaxEachPostBytes = "1000000", |         scMaxEachPostBytes = "1000000", | ||||||
|         scMinPostsIntervalMs = "30", |  | ||||||
|         noSSEHeader = false, |         noSSEHeader = false, | ||||||
|         xPaddingBytes = "100-1000", |         xPaddingBytes = "100-1000", | ||||||
|         xmux = { |  | ||||||
|             maxConcurrency: "16-32", |  | ||||||
|             maxConnections: 0, |  | ||||||
|             cMaxReuseTimes: "64-128", |  | ||||||
|             cMaxLifetimeMs: 0, |  | ||||||
|             hMaxRequestTimes: "800-900", |  | ||||||
|             hKeepAlivePeriod: 0, |  | ||||||
|         }, |  | ||||||
|         mode = MODE_OPTION.AUTO, |         mode = MODE_OPTION.AUTO, | ||||||
|         noGRPCHeader = false |  | ||||||
|     ) { |     ) { | ||||||
|         super(); |         super(); | ||||||
|         this.path = path; |         this.path = path; | ||||||
|  | @ -516,12 +506,9 @@ class xHTTPStreamSettings extends XrayCommonClass { | ||||||
|         this.headers = headers; |         this.headers = headers; | ||||||
|         this.scMaxBufferedPosts = scMaxBufferedPosts; |         this.scMaxBufferedPosts = scMaxBufferedPosts; | ||||||
|         this.scMaxEachPostBytes = scMaxEachPostBytes; |         this.scMaxEachPostBytes = scMaxEachPostBytes; | ||||||
|         this.scMinPostsIntervalMs = scMinPostsIntervalMs; |  | ||||||
|         this.noSSEHeader = noSSEHeader; |         this.noSSEHeader = noSSEHeader; | ||||||
|         this.xPaddingBytes = xPaddingBytes; |         this.xPaddingBytes = xPaddingBytes; | ||||||
|         this.xmux = xmux; |  | ||||||
|         this.mode = mode; |         this.mode = mode; | ||||||
|         this.noGRPCHeader = noGRPCHeader; |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     addHeader(name, value) { |     addHeader(name, value) { | ||||||
|  | @ -539,12 +526,9 @@ class xHTTPStreamSettings extends XrayCommonClass { | ||||||
|             XrayCommonClass.toHeaders(json.headers), |             XrayCommonClass.toHeaders(json.headers), | ||||||
|             json.scMaxBufferedPosts, |             json.scMaxBufferedPosts, | ||||||
|             json.scMaxEachPostBytes, |             json.scMaxEachPostBytes, | ||||||
|             json.scMinPostsIntervalMs, |  | ||||||
|             json.noSSEHeader, |             json.noSSEHeader, | ||||||
|             json.xPaddingBytes, |             json.xPaddingBytes, | ||||||
|             json.xmux, |  | ||||||
|             json.mode, |             json.mode, | ||||||
|             json.noGRPCHeader, |  | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -555,19 +539,9 @@ class xHTTPStreamSettings extends XrayCommonClass { | ||||||
|             headers: XrayCommonClass.toV2Headers(this.headers, false), |             headers: XrayCommonClass.toV2Headers(this.headers, false), | ||||||
|             scMaxBufferedPosts: this.scMaxBufferedPosts, |             scMaxBufferedPosts: this.scMaxBufferedPosts, | ||||||
|             scMaxEachPostBytes: this.scMaxEachPostBytes, |             scMaxEachPostBytes: this.scMaxEachPostBytes, | ||||||
|             scMinPostsIntervalMs: this.scMinPostsIntervalMs, |  | ||||||
|             noSSEHeader: this.noSSEHeader, |             noSSEHeader: this.noSSEHeader, | ||||||
|             xPaddingBytes: this.xPaddingBytes, |             xPaddingBytes: this.xPaddingBytes, | ||||||
|             xmux: { |  | ||||||
|                 maxConcurrency: this.xmux.maxConcurrency, |  | ||||||
|                 maxConnections: this.xmux.maxConnections, |  | ||||||
|                 cMaxReuseTimes: this.xmux.cMaxReuseTimes, |  | ||||||
|                 cMaxLifetimeMs: this.xmux.cMaxLifetimeMs, |  | ||||||
|                 hMaxRequestTimes: this.xmux.hMaxRequestTimes, |  | ||||||
|                 hKeepAlivePeriod: this.xmux.hKeepAlivePeriod, |  | ||||||
|             }, |  | ||||||
|             mode: this.mode, |             mode: this.mode, | ||||||
|             noGRPCHeader: this.noGRPCHeader, |  | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -287,11 +287,24 @@ class xHTTPStreamSettings extends CommonClass { | ||||||
|         path = '/', |         path = '/', | ||||||
|         host = '', |         host = '', | ||||||
|         mode = '', |         mode = '', | ||||||
|  |         noGRPCHeader = false, | ||||||
|  |         scMinPostsIntervalMs = "30", | ||||||
|  |         xmux = { | ||||||
|  |             maxConcurrency: "16-32", | ||||||
|  |             maxConnections: 0, | ||||||
|  |             cMaxReuseTimes: "64-128", | ||||||
|  |             cMaxLifetimeMs: 0, | ||||||
|  |             hMaxRequestTimes: "800-900", | ||||||
|  |             hKeepAlivePeriod: 0, | ||||||
|  |         }, | ||||||
|     ) { |     ) { | ||||||
|         super(); |         super(); | ||||||
|         this.path = path; |         this.path = path; | ||||||
|         this.host = host; |         this.host = host; | ||||||
|         this.mode = mode; |         this.mode = mode; | ||||||
|  |         this.noGRPCHeader = noGRPCHeader; | ||||||
|  |         this.scMinPostsIntervalMs = scMinPostsIntervalMs; | ||||||
|  |         this.xmux = xmux; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     static fromJson(json = {}) { |     static fromJson(json = {}) { | ||||||
|  | @ -299,6 +312,9 @@ class xHTTPStreamSettings extends CommonClass { | ||||||
|             json.path, |             json.path, | ||||||
|             json.host, |             json.host, | ||||||
|             json.mode, |             json.mode, | ||||||
|  |             json.noGRPCHeader, | ||||||
|  |             json.scMinPostsIntervalMs, | ||||||
|  |             json.xmux | ||||||
|         ); |         ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -307,6 +323,16 @@ class xHTTPStreamSettings extends CommonClass { | ||||||
|             path: this.path, |             path: this.path, | ||||||
|             host: this.host, |             host: this.host, | ||||||
|             mode: this.mode, |             mode: this.mode, | ||||||
|  |             noGRPCHeader: this.noGRPCHeader, | ||||||
|  |             scMinPostsIntervalMs: this.scMinPostsIntervalMs, | ||||||
|  |             xmux: { | ||||||
|  |                 maxConcurrency: this.xmux.maxConcurrency, | ||||||
|  |                 maxConnections: this.xmux.maxConnections, | ||||||
|  |                 cMaxReuseTimes: this.xmux.cMaxReuseTimes, | ||||||
|  |                 cMaxLifetimeMs: this.xmux.cMaxLifetimeMs, | ||||||
|  |                 hMaxRequestTimes: this.xmux.hMaxRequestTimes, | ||||||
|  |                 hKeepAlivePeriod: this.xmux.hKeepAlivePeriod, | ||||||
|  |             }, | ||||||
|         }; |         }; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -377,6 +377,30 @@ | ||||||
|               <a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option> |               <a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option> | ||||||
|             </a-select> |             </a-select> | ||||||
|           </a-form-item> |           </a-form-item> | ||||||
|  |           <a-form-item label="No gRPC Header" v-if="outbound.stream.xhttp.mode === 'stream-up' || outbound.stream.xhttp.mode === 'stream-one'"> | ||||||
|  |             <a-switch v-model="outbound.stream.xhttp.noGRPCHeader"></a-switch> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label="Min Upload Interval (Ms)" v-if="outbound.stream.xhttp.mode === 'packet-up'"> | ||||||
|  |             <a-input v-model.trim="outbound.stream.xhttp.scMinPostsIntervalMs"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label="Max Concurrency" v-if="!outbound.stream.xhttp.xmux.maxConnections"> | ||||||
|  |             <a-input v-model="outbound.stream.xhttp.xmux.maxConcurrency"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label="Max Connections" v-if="!outbound.stream.xhttp.xmux.maxConcurrency"> | ||||||
|  |             <a-input v-model="outbound.stream.xhttp.xmux.maxConnections"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label="Max Reuse Times"> | ||||||
|  |             <a-input v-model="outbound.stream.xhttp.xmux.cMaxReuseTimes"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label="Max Lifetime (ms)"> | ||||||
|  |             <a-input v-model="outbound.stream.xhttp.xmux.cMaxLifetimeMs"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label="Max Request Times"> | ||||||
|  |             <a-input v-model="outbound.stream.xhttp.xmux.hMaxRequestTimes"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|  |           <a-form-item label='Keep Alive Period'> | ||||||
|  |             <a-input v-model.number="outbound.stream.xhttp.xmux.hKeepAlivePeriod"></a-input> | ||||||
|  |           </a-form-item> | ||||||
|         </template> |         </template> | ||||||
|       </template> |       </template> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -27,41 +27,17 @@ | ||||||
|             <a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option> |             <a-select-option v-for="key in MODE_OPTION" :value="key">[[ key ]]</a-select-option> | ||||||
|         </a-select> |         </a-select> | ||||||
|     </a-form-item> |     </a-form-item> | ||||||
|     <a-form-item label="Max Buffered Upload"> |     <a-form-item label="Max Buffered Upload" v-if="inbound.stream.xhttp.mode === 'packet-up'"> | ||||||
|         <a-input v-model.trim="inbound.stream.xhttp.scMaxBufferedPosts"></a-input> |         <a-input v-model.trim="inbound.stream.xhttp.scMaxBufferedPosts"></a-input> | ||||||
|     </a-form-item> |     </a-form-item> | ||||||
|     <a-form-item label="Max Upload Size (Byte)"> |     <a-form-item label="Max Upload Size (Byte)" v-if="inbound.stream.xhttp.mode === 'packet-up'"> | ||||||
|         <a-input v-model.trim="inbound.stream.xhttp.scMaxEachPostBytes"></a-input> |         <a-input v-model.trim="inbound.stream.xhttp.scMaxEachPostBytes"></a-input> | ||||||
|     </a-form-item> |     </a-form-item> | ||||||
|     <a-form-item label="Min Upload Interval (Ms)"> |  | ||||||
|         <a-input v-model.trim="inbound.stream.xhttp.scMinPostsIntervalMs"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label="Padding Bytes"> |     <a-form-item label="Padding Bytes"> | ||||||
|         <a-input v-model.trim="inbound.stream.xhttp.xPaddingBytes"></a-input> |         <a-input v-model.trim="inbound.stream.xhttp.xPaddingBytes"></a-input> | ||||||
|     </a-form-item> |     </a-form-item> | ||||||
|     <a-form-item label="No SSE Header"> |     <a-form-item label="No SSE Header"> | ||||||
|         <a-switch v-model="inbound.stream.xhttp.noSSEHeader"></a-switch> |         <a-switch v-model="inbound.stream.xhttp.noSSEHeader"></a-switch> | ||||||
|     </a-form-item> |     </a-form-item> | ||||||
|     <a-form-item label="Max Concurrency" v-if="!inbound.stream.xhttp.xmux.maxConnections"> |  | ||||||
|         <a-input v-model="inbound.stream.xhttp.xmux.maxConcurrency"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label="Max Connections" v-if="!inbound.stream.xhttp.xmux.maxConcurrency"> |  | ||||||
|         <a-input v-model="inbound.stream.xhttp.xmux.maxConnections"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label="Max Reuse Times"> |  | ||||||
|         <a-input v-model="inbound.stream.xhttp.xmux.cMaxReuseTimes"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label="Max Lifetime (ms)"> |  | ||||||
|         <a-input v-model="inbound.stream.xhttp.xmux.cMaxLifetimeMs"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label="Max Request Times"> |  | ||||||
|         <a-input v-model="inbound.stream.xhttp.xmux.hMaxRequestTimes"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label='Keep Alive Period'> |  | ||||||
|         <a-input v-model.number="inbound.stream.xhttp.xmux.hKeepAlivePeriod"></a-input> |  | ||||||
|     </a-form-item> |  | ||||||
|     <a-form-item label="No gRPC Header"> |  | ||||||
|         <a-switch v-model="inbound.stream.xhttp.noGRPCHeader"></a-switch> |  | ||||||
|     </a-form-item> |  | ||||||
| </a-form> | </a-form> | ||||||
| {{end}} | {{end}} | ||||||
		Loading…
	
		Reference in a new issue
	
	 mhsanaei
						mhsanaei