Skip to content

Commit 253c671

Browse files
author
code3-dev
committed
fix http
1 parent 6c8e44d commit 253c671

File tree

1 file changed

+22
-0
lines changed
  • local_packages/flutter_v2ray/lib/url

1 file changed

+22
-0
lines changed

local_packages/flutter_v2ray/lib/url/url.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ abstract class V2RayURL {
127127
"realitySettings": null,
128128
"grpcSettings": null,
129129
"dsSettings": null,
130+
"httpupgradeSettings": null,
131+
"xhttpSettings": null,
130132
"sockopt": null
131133
};
132134

@@ -226,6 +228,26 @@ abstract class V2RayURL {
226228
"multiMode": mode == "multi",
227229
};
228230
sni = host ?? "";
231+
} else if (transport == 'httpupgrade') {
232+
streamSetting['httpupgradeSettings'] = {
233+
"path": path ?? "/",
234+
"host": host ?? "",
235+
"headers": {
236+
"Host": host ?? "",
237+
},
238+
};
239+
sni = host ?? "";
240+
} else if (transport == 'xhttp') {
241+
streamSetting['xhttpSettings'] = {
242+
"path": path ?? "/",
243+
"host": host ?? "",
244+
"headers": {
245+
"Host": host ?? "",
246+
},
247+
"mode": mode ?? "auto",
248+
"extra": {},
249+
};
250+
sni = host ?? "";
229251
}
230252
return sni;
231253
}

0 commit comments

Comments
 (0)