Add Snell protocol. Refactor MASQUE HTTP/2, Fair Queue. Update XHTTP, OpenVPN, Sudoku, Fallback. Fixes

This commit is contained in:
Shtorm
2026-06-26 01:25:57 +03:00
parent d174962a04
commit edf38d33d6
107 changed files with 5346 additions and 708 deletions

View File

@@ -2,6 +2,7 @@ package v2raygrpc
import (
"context"
"strings"
"google.golang.org/grpc"
)
@@ -13,13 +14,21 @@ type GunService interface {
}
func ServerDesc(name string) grpc.ServiceDesc {
serviceName := name
streamName := "Tun"
if strings.Contains(name, "/") {
name = strings.TrimPrefix(name, "/")
lastSlash := strings.LastIndex(name, "/")
serviceName = name[:lastSlash]
streamName = name[lastSlash+1:]
}
return grpc.ServiceDesc{
ServiceName: name,
ServiceName: serviceName,
HandlerType: (*GunServiceServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Tun",
StreamName: streamName,
Handler: _GunService_Tun_Handler,
ServerStreams: true,
ClientStreams: true,
@@ -30,7 +39,11 @@ func ServerDesc(name string) grpc.ServiceDesc {
}
func (c *gunServiceClient) TunCustomName(ctx context.Context, name string, opts ...grpc.CallOption) (GunService_TunClient, error) {
stream, err := c.cc.NewStream(ctx, &ServerDesc(name).Streams[0], "/"+name+"/Tun", opts...)
path := "/" + name + "/Tun"
if strings.Contains(name, "/") {
path = name
}
stream, err := c.cc.NewStream(ctx, &ServerDesc(name).Streams[0], path, opts...)
if err != nil {
return nil, err
}