fix sockopt in all protocols

This commit is contained in:
Alireza Ahmadi
2024-03-12 13:58:31 +01:00
parent cf521367f7
commit 463a120d58

View File

@@ -553,11 +553,18 @@ class Outbound extends CommonClass {
}
toJson() {
var stream;
if (this.canEnableStream()) {
stream = this.stream.toJson();
} else {
if (this.stream?.sockopt)
stream = { sockopt: this.stream.sockopt.toJson() };
}
return {
tag: this.tag == '' ? undefined : this.tag,
protocol: this.protocol,
settings: this.settings instanceof CommonClass ? this.settings.toJson() : this.settings,
streamSettings: this.canEnableStream() ? this.stream.toJson() : undefined,
streamSettings: stream,
mux: this.mux?.enabled ? this.mux : undefined,
};
}