Fix XHTTP range defaults (sc_max_each_post_bytes, sc_min_posts_interval_ms) to be strings, as expected by sing-box json parser
This commit is contained in:
@@ -1777,8 +1777,8 @@ function apply_link_transport(outbound, query) {
|
||||
result.path = as_string(query.path || "") != "" ? as_string(query.path) : "/";
|
||||
result.x_padding_bytes = "100-1000";
|
||||
result.no_grpc_header = false;
|
||||
result.sc_max_each_post_bytes = 1000000;
|
||||
result.sc_min_posts_interval_ms = 30;
|
||||
result.sc_max_each_post_bytes = "1000000";
|
||||
result.sc_min_posts_interval_ms = "30";
|
||||
optional_query_string(result, "host", as_string(query.host || "") != "" ? query.host : query.sni);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -177,7 +177,7 @@ function apply_transport(inbound, section, protocol) {
|
||||
transport.headers = {};
|
||||
transport.x_padding_bytes = "100-1000";
|
||||
transport.no_sse_header = false;
|
||||
transport.sc_max_each_post_bytes = 1000000;
|
||||
transport.sc_max_each_post_bytes = "1000000";
|
||||
transport.sc_max_buffered_posts = 30;
|
||||
transport.sc_stream_up_server_secs = "20-80";
|
||||
transport.server_max_header_bytes = 8192;
|
||||
|
||||
@@ -665,8 +665,8 @@ function add_transport(url) {
|
||||
path: path,
|
||||
x_padding_bytes: "100-1000",
|
||||
no_grpc_header: false,
|
||||
sc_max_each_post_bytes: 1000000,
|
||||
sc_min_posts_interval_ms: 30
|
||||
sc_max_each_post_bytes: "1000000",
|
||||
sc_min_posts_interval_ms: "30"
|
||||
};
|
||||
if (host != "")
|
||||
result.host = host;
|
||||
@@ -2154,8 +2154,8 @@ function xray_transport_from_stream(stream) {
|
||||
path: as_string(settings.path || "/"),
|
||||
x_padding_bytes: "100-1000",
|
||||
no_grpc_header: false,
|
||||
sc_max_each_post_bytes: 1000000,
|
||||
sc_min_posts_interval_ms: 30
|
||||
sc_max_each_post_bytes: "1000000",
|
||||
sc_min_posts_interval_ms: "30"
|
||||
};
|
||||
if (result.mode != "auto" && result.mode != "packet-up" && result.mode != "stream-up" && result.mode != "stream-one")
|
||||
result.mode = "auto";
|
||||
@@ -2628,7 +2628,7 @@ function normalize_sing_box_xhttp_transport(outbound) {
|
||||
return outbound;
|
||||
|
||||
outbound.transport.x_padding_bytes = xhttp_positive_range_or_default(outbound.transport.x_padding_bytes, "100-1000");
|
||||
let sc_max_each_post_bytes = xhttp_present_positive_range_or_default(outbound.transport.sc_max_each_post_bytes, 1000000);
|
||||
let sc_max_each_post_bytes = xhttp_present_positive_range_or_default(outbound.transport.sc_max_each_post_bytes, "1000000");
|
||||
if (sc_max_each_post_bytes != null)
|
||||
outbound.transport.sc_max_each_post_bytes = sc_max_each_post_bytes;
|
||||
return outbound;
|
||||
|
||||
Reference in New Issue
Block a user