Skip to content

Commit

Permalink
fix(subscription): h3 transport
Browse files Browse the repository at this point in the history
  • Loading branch information
M03ED committed Oct 14, 2024
1 parent 23bd92f commit a930ed4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/subscription/singbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ def make_outbound(self,
if net == 'h2':
net = 'http'
alpn = 'h2'
elif net == 'h3':
net = 'http'
alpn = 'h3'
elif net in ['tcp', 'raw'] and headers == 'http':
net = 'http'

Expand Down
6 changes: 5 additions & 1 deletion app/subscription/v2ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ def http_config(self, net="http", path: str = "", host: str = "", random_user_ag
config = copy.deepcopy(self.settings.get("h2Settings", {
"header": {}
}))
elif net == "h3":
config = copy.deepcopy(self.settings.get("h3Settings", {
"header": {}
}))
else:
config = self.settings.get("httpSettings", {
"header": {}
Expand Down Expand Up @@ -860,7 +864,7 @@ def make_stream_setting(self,
elif net == "grpc":
network_setting = self.grpc_config(
path=path, host=host, multiMode=multiMode, random_user_agent=random_user_agent)
elif net in ("h2", "http"):
elif net in ("h3", "h2", "http"):
network_setting = self.http_config(
net=net, path=path, host=host, random_user_agent=random_user_agent)
elif net == "kcp":
Expand Down
5 changes: 5 additions & 0 deletions app/templates/v2ray/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
"Pragma": "no-cache"
}
},
"h3Settings": {
"headers": {
"Pragma": "no-cache"
}
},
"httpupgradeSettings": {
"headers": {
"Pragma": "no-cache"
Expand Down

0 comments on commit a930ed4

Please sign in to comment.