File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1691,7 +1691,7 @@ class Inbound extends XrayCommonClass {
16911691
16921692 toJson ( ) {
16931693 let streamSettings ;
1694- if ( this . canEnableStream ( ) ) {
1694+ if ( this . canEnableStream ( ) || this . stream ?. sockopt ) {
16951695 streamSettings = this . stream . toJson ( ) ;
16961696 }
16971697 return {
Original file line number Diff line number Diff line change 925925 protocol : inbound . protocol ,
926926 settings : inbound . settings . toString ( ) ,
927927 } ;
928- if ( inbound . canEnableStream ( ) ) data . streamSettings = inbound . stream . toString ( ) ;
928+ if ( inbound . canEnableStream ( ) ) {
929+ data . streamSettings = inbound . stream . toString ( ) ;
930+ } else if ( inbound . stream ?. sockopt ) {
931+ data . streamSettings = JSON . stringify ( { sockopt : inbound . stream . sockopt . toJson ( ) } , null , 2 ) ;
932+ }
929933 data . sniffing = inbound . sniffing . toString ( ) ;
930934
931935 await this . submit ( '/xui/inbound/add' , data , inModal ) ;
944948 protocol : inbound . protocol ,
945949 settings : inbound . settings . toString ( ) ,
946950 } ;
947- if ( inbound . canEnableStream ( ) ) data . streamSettings = inbound . stream . toString ( ) ;
951+ if ( inbound . canEnableStream ( ) ) {
952+ data . streamSettings = inbound . stream . toString ( ) ;
953+ } else if ( inbound . stream ?. sockopt ) {
954+ data . streamSettings = JSON . stringify ( { sockopt : inbound . stream . sockopt . toJson ( ) } , null , 2 ) ;
955+ }
948956 data . sniffing = inbound . sniffing . toString ( ) ;
949957
950958 await this . submit ( `/xui/inbound/update/${ dbInbound . id } ` , data , inModal ) ;
You can’t perform that action at this time.
0 commit comments