New - gRPC Authority

This commit is contained in:
MHSanaei
2024-03-11 13:00:00 +03:30
parent 102864525c
commit 01cd7539f9
3 changed files with 15 additions and 0 deletions

View File

@@ -446,16 +446,19 @@ class QuicStreamSettings extends XrayCommonClass {
class GrpcStreamSettings extends XrayCommonClass {
constructor(
serviceName="",
authority="",
multiMode=false,
) {
super();
this.serviceName = serviceName;
this.authority = authority;
this.multiMode = multiMode;
}
static fromJson(json={}) {
return new GrpcStreamSettings(
json.serviceName,
json.authority,
json.multiMode
);
}
@@ -463,6 +466,7 @@ class GrpcStreamSettings extends XrayCommonClass {
toJson() {
return {
serviceName: this.serviceName,
authority: this.authority,
multiMode: this.multiMode,
}
}
@@ -1240,6 +1244,7 @@ class Inbound extends XrayCommonClass {
obj.path = this.stream.quic.key;
} else if (network === 'grpc') {
obj.path = this.stream.grpc.serviceName;
obj.authority = this.stream.grpc.authority;
if (this.stream.grpc.multiMode){
obj.type = 'multi'
}
@@ -1315,6 +1320,7 @@ class Inbound extends XrayCommonClass {
case "grpc":
const grpc = this.stream.grpc;
params.set("serviceName", grpc.serviceName);
params.set("authority", grpc.authority);
if(grpc.multiMode){
params.set("mode", "multi");
}
@@ -1434,6 +1440,7 @@ class Inbound extends XrayCommonClass {
case "grpc":
const grpc = this.stream.grpc;
params.set("serviceName", grpc.serviceName);
params.set("authority", grpc.authority);
if(grpc.multiMode){
params.set("mode", "multi");
}
@@ -1520,6 +1527,7 @@ class Inbound extends XrayCommonClass {
case "grpc":
const grpc = this.stream.grpc;
params.set("serviceName", grpc.serviceName);
params.set("authority", grpc.authority);
if(grpc.multiMode){
params.set("mode", "multi");
}