0 | module Node.HTTP2.CreateSecureServer
3 | import Node.HTTP2.CreateServer
4 | import Node.HTTP2.Module
5 | import Node.Internal.Support
6 | import public Node.Net.CreateServer
7 | import public Node.TLS.CreateServer
8 | import public Node.TLS.CreateSecureContext
11 | record Options where
12 | constructor MkOptions
14 | maxDeflateDynamicTableSize: Int
16 | maxSessionMemory: Int
17 | maxHeaderListPairs: Int
18 | maxOutstandingPings: Int
19 | maxSendHeaderBlockLength: Maybe Int
20 | paddingStrategy: PaddingStrategy
21 | peerMaxConcurrentStreams: Int
22 | maxSessionInvalidFrames: Int
23 | maxSessionRejectedStreams: Int
25 | origins: List String
26 | unknownProtocolTimeout: Int
29 | defaultOptions : CreateSecureServer.Options
30 | defaultOptions = MkOptions
31 | { allowHTTP1 = False
32 | , maxDeflateDynamicTableSize = 4096
34 | , maxSessionMemory = 10
35 | , maxHeaderListPairs = 128
36 | , maxOutstandingPings = 10
37 | , maxSendHeaderBlockLength = Nothing
38 | , paddingStrategy = None
39 | , peerMaxConcurrentStreams = 100
40 | , maxSessionInvalidFrames = 1000
41 | , maxSessionRejectedStreams = 100
42 | , settings = defaultSettings
44 | , unknownProtocolTimeout = 10000
50 | , maxDeflateDynamicTableSize
53 | , maxHeaderListPairs
54 | , maxOutstandingPings
55 | , maxSendHeaderBlockLength
57 | , peerMaxConcurrentStreams
58 | , maxSessionInvalidFrames
59 | , maxSessionRejectedStreams
62 | , unknownProtocolTimeout
64 | allowHTTP1: _bool(allowHTTP1),
65 | maxDeflateDynamicTableSize,
69 | maxOutstandingPings,
70 | maxSendHeaderBlockLength: _maybe(maxSendHeaderBlockLength),
72 | peerMaxConcurrentStreams,
73 | maxSessionInvalidFrames,
74 | maxSessionRejectedStreams,
76 | origins: __prim_idris2js_array(origins),
77 | unknownProtocolTimeout
80 | ffi_convertOptions :
81 | (allowHTTP1: Bool) ->
82 | (maxDeflateDynamicTableSize: Int) ->
83 | (maxSettings: Int) ->
84 | (maxSessionMemory: Int) ->
85 | (maxHeaderListPairs: Int) ->
86 | (maxOutstandingPings: Int) ->
87 | (maxSendHeaderBlockLength: Maybe Int) ->
88 | (paddingStrategy: Node PaddingStrategy) ->
89 | (peerMaxConcurrentStreams: Int) ->
90 | (maxSessionInvalidFrames: Int) ->
91 | (maxSessionRejectedStreams: Int) ->
92 | (settings: Node Settings) ->
93 | (origins: List String) ->
94 | (unknownProtocolTimeout: Int) ->
95 | Node CreateSecureServer.Options
98 | convertOptions : {auto http : HTTP2Module} -> CreateSecureServer.Options -> Node CreateSecureServer.Options
99 | convertOptions o = ffi_convertOptions
101 | o.maxDeflateDynamicTableSize
104 | o.maxHeaderListPairs
105 | o.maxOutstandingPings
106 | o.maxSendHeaderBlockLength
107 | (convertPaddingStrategy o.paddingStrategy)
108 | o.peerMaxConcurrentStreams
109 | o.maxSessionInvalidFrames
110 | o.maxSessionRejectedStreams
111 | (convertSettings o.settings)
113 | o.unknownProtocolTimeout
118 | record Options where
119 | constructor MkOptions
120 | server: HTTP2.CreateSecureServer.Options
121 | context: TLS.CreateSecureContext.Options
122 | tls: TLS.CreateServer.Options
123 | net: Net.CreateServer.Options
126 | defaultOptions : HTTP2.CreateSecureServer.Command.Options
127 | defaultOptions = MkOptions
128 | { server = defaultOptions
129 | , context = defaultOptions
130 | , tls = defaultOptions
131 | , net = defaultOptions
147 | ffi_convertOptions :
148 | (server : Node HTTP2.CreateSecureServer.Options)
149 | -> (context : Node TLS.CreateSecureContext.Options)
150 | -> (tls : Node TLS.CreateServer.Options)
151 | -> (net : Node Net.CreateServer.Options)
152 | -> Node CreateSecureServer.Command.Options
155 | convertOptions : {auto http : HTTP2Module} -> HTTP2.CreateSecureServer.Command.Options -> Node HTTP2.CreateSecureServer.Command.Options
156 | convertOptions o = ffi_convertOptions
157 | (convertOptions o.server)
158 | (convertOptions o.context)
159 | (convertOptions o.tls)
160 | (convertOptions o.net)