@@ -13,7 +13,7 @@ let createV2FlyObjectFromUri (uriObject: System.Uri) =
13
13
let protocolSetting =
14
14
match uriObject.Scheme with
15
15
| " vmess" ->
16
- createVMessObject ( uriObject.Host, uriObject.Port, uriObject.UserInfo, VMessSecurity.Auto)
16
+ createVMessObject uriObject.Host uriObject.Port uriObject.UserInfo VMessSecurity.Auto
17
17
|> Success
18
18
| unknown -> Failure([ ShareLinkFormatException $" unknown sharelink protocol {unknown}" ])
19
19
@@ -34,11 +34,11 @@ let createV2FlyObjectFromUri (uriObject: System.Uri) =
34
34
let securitySetting =
35
35
match securityType with
36
36
| " tls" ->
37
- createTLSObject (
38
- tryRetrieveFromShareLink " sni" ,
39
- tryRetrieveFromShareLink " alpn"
40
- |> Option.map ( fun alpn -> alpn.Split( " ," ) |> Seq.toList)
41
- )
37
+ createTLSObject
38
+ ( tryRetrieveFromShareLink " sni" )
39
+ ( tryRetrieveFromShareLink " alpn"
40
+ |> Option.map ( fun alpn -> alpn.Split( " ," ) |> Seq.toList) )
41
+
42
42
|> Success
43
43
| " none" -> Success( TransportSecurity.None)
44
44
| unsupported -> Failure([ ShareLinkFormatException $" unsupported security type {unsupported}" ])
@@ -53,28 +53,26 @@ let createV2FlyObjectFromUri (uriObject: System.Uri) =
53
53
( fun transportType ->
54
54
match transportType with
55
55
| " ws" ->
56
- createWebSocketObject (
57
- ( tryRetrieveFromShareLink " path" ),
58
- None,
59
- None,
60
- None,
61
- ( tryRetrieveFromShareLink " host" ),
62
- None
63
- )
56
+ createWebSocketObject ( tryRetrieveFromShareLink " path" ) None None None ( tryRetrieveFromShareLink " host" ) None
57
+
64
58
|> Success
65
59
| " grpc" ->
66
60
retrieveFromShareLink " serviceName"
67
61
|> Result.mapError ( fun e -> [ e ])
68
62
|> Validation.ofResult
69
63
|> Validation.map createGrpcObject
70
64
| " http" ->
71
- createHttpObject ( tryRetrieveFromShareLink " path" , tryRetrieveFromShareLink " host" , Dictionary())
65
+ createHttpObjectWithHost
66
+ ( tryRetrieveFromShareLink " path" )
67
+ ( tryRetrieveFromShareLink " host" )
68
+ ( HTTP2)
69
+ ( Some( Dictionary()))
72
70
|> Success
73
71
| " quic" -> createQuicObject () |> Success
74
72
| " kcp" ->
75
- createKCPObject ( None, None, None, None, None, None, None, ( tryRetrieveFromShareLink " seed" ) )
73
+ createKCPObject None None None None None None None ( tryRetrieveFromShareLink " seed" )
76
74
|> Success
77
- | " tcp" -> createTCPObject () |> Success
75
+ | " tcp" -> createHttpObjectWithHost None None HTTP1 None |> Success
78
76
| unknown -> Failure([ ConfigurationParameterException $" unknown transport protocol {unknown}" ]))
79
77
transportType
80
78
0 commit comments