@@ -90,16 +90,17 @@ import Unsafe.Coerce (unsafeCoerce)
90
90
91
91
-- | Create an HTTPS server, given the SSL options and a function to be executed
92
92
-- | when a request is received.
93
- foreign import createServerImpl ::
94
- Foreign ->
95
- (Request -> Response -> Effect Unit ) ->
96
- Effect Server
93
+ foreign import createServerImpl
94
+ :: Foreign
95
+ -> (Request -> Response -> Effect Unit )
96
+ -> Effect Server
97
97
98
98
-- | Create an HTTPS server, given the SSL options and a function to be executed
99
99
-- | when a request is received.
100
- createServer :: Options SSLOptions ->
101
- (Request -> Response -> Effect Unit ) ->
102
- Effect Server
100
+ createServer
101
+ :: Options SSLOptions
102
+ -> (Request -> Response -> Effect Unit )
103
+ -> Effect Server
103
104
createServer = createServerImpl <<< options
104
105
105
106
-- | The type of HTTPS server options
@@ -120,16 +121,22 @@ rejectUnauthorized = opt "rejectUnauthorized"
120
121
-- | The npnProtocols option can be a String, a Buffer, a Uint8Array, or an
121
122
-- | array of any of those types.
122
123
data NPNProtocols
124
+
123
125
npnProtocolsString :: String -> NPNProtocols
124
126
npnProtocolsString = unsafeCoerce
127
+
125
128
npnProtocolsBuffer :: Buffer -> NPNProtocols
126
129
npnProtocolsBuffer = unsafeCoerce
130
+
127
131
npnProtocolsUint8Array :: Uint8Array -> NPNProtocols
128
132
npnProtocolsUint8Array = unsafeCoerce
133
+
129
134
npnProtocolsStringArray :: Array String -> NPNProtocols
130
135
npnProtocolsStringArray = unsafeCoerce
136
+
131
137
npnProtocolsBufferArray :: Array Buffer -> NPNProtocols
132
138
npnProtocolsBufferArray = unsafeCoerce
139
+
133
140
npnProtocolsUint8ArrayArray :: Array Uint8Array -> NPNProtocols
134
141
npnProtocolsUint8ArrayArray = unsafeCoerce
135
142
@@ -140,16 +147,22 @@ npnProtocols = opt "NPNProtocols"
140
147
-- | The alpnProtocols option can be a String, a Buffer, a Uint8Array, or an
141
148
-- | array of any of those types.
142
149
data ALPNProtocols
150
+
143
151
alpnProtocolsString :: String -> ALPNProtocols
144
152
alpnProtocolsString = unsafeCoerce
153
+
145
154
alpnProtocolsBuffer :: Buffer -> ALPNProtocols
146
155
alpnProtocolsBuffer = unsafeCoerce
156
+
147
157
alpnProtocolsUint8Array :: Uint8Array -> ALPNProtocols
148
158
alpnProtocolsUint8Array = unsafeCoerce
159
+
149
160
alpnProtocolsStringArray :: Array String -> ALPNProtocols
150
161
alpnProtocolsStringArray = unsafeCoerce
162
+
151
163
alpnProtocolsBufferArray :: Array Buffer -> ALPNProtocols
152
164
alpnProtocolsBufferArray = unsafeCoerce
165
+
153
166
alpnProtocolsUint8ArrayArray :: Array Uint8Array -> ALPNProtocols
154
167
alpnProtocolsUint8ArrayArray = unsafeCoerce
155
168
@@ -167,8 +180,10 @@ ticketKeys = opt "ticketKeys"
167
180
168
181
-- | The PFX option can take either a String or a Buffer
169
182
data PFX
183
+
170
184
pfxString :: String -> PFX
171
185
pfxString = unsafeCoerce
186
+
172
187
pfxBuffer :: Buffer -> PFX
173
188
pfxBuffer = unsafeCoerce
174
189
@@ -179,12 +194,16 @@ pfx = opt "pfx"
179
194
-- | The key option can be a String, a Buffer, an array of strings, or an array
180
195
-- | of buffers.
181
196
data Key
197
+
182
198
keyString :: String -> Key
183
199
keyString = unsafeCoerce
200
+
184
201
keyBuffer :: Buffer -> Key
185
202
keyBuffer = unsafeCoerce
203
+
186
204
keyStringArray :: Array String -> Key
187
205
keyStringArray = unsafeCoerce
206
+
188
207
keyBufferArray :: Array Buffer -> Key
189
208
keyBufferArray = unsafeCoerce
190
209
@@ -199,12 +218,16 @@ passphrase = opt "passphrase"
199
218
-- | The cert option can be a String, a Buffer, an array of strings, or an array
200
219
-- | of buffers.
201
220
data Cert
221
+
202
222
certString :: String -> Cert
203
223
certString = unsafeCoerce
224
+
204
225
certBuffer :: Buffer -> Cert
205
226
certBuffer = unsafeCoerce
227
+
206
228
certStringArray :: Array String -> Cert
207
229
certStringArray = unsafeCoerce
230
+
208
231
certBufferArray :: Array Buffer -> Cert
209
232
certBufferArray = unsafeCoerce
210
233
@@ -215,12 +238,16 @@ cert = opt "cert"
215
238
-- | The CA option can be a String, a Buffer, an array of strings, or an array
216
239
-- | of buffers.
217
240
data CA
241
+
218
242
caString :: String -> CA
219
243
caString = unsafeCoerce
244
+
220
245
caBuffer :: Buffer -> CA
221
246
caBuffer = unsafeCoerce
247
+
222
248
caStringArray :: Array String -> CA
223
249
caStringArray = unsafeCoerce
250
+
224
251
caBufferArray :: Array Buffer -> CA
225
252
caBufferArray = unsafeCoerce
226
253
@@ -231,12 +258,16 @@ ca = opt "ca"
231
258
-- | The CRL option can be a String, a Buffer, an array of strings, or an array
232
259
-- | of buffers.
233
260
data CRL
261
+
234
262
crlString :: String -> CRL
235
263
crlString = unsafeCoerce
264
+
236
265
crlBuffer :: Buffer -> CRL
237
266
crlBuffer = unsafeCoerce
267
+
238
268
crlStringArray :: Array String -> CRL
239
269
crlStringArray = unsafeCoerce
270
+
240
271
crlBufferArray :: Array Buffer -> CRL
241
272
crlBufferArray = unsafeCoerce
242
273
@@ -258,8 +289,10 @@ ecdhCurve = opt "ecdhCurve"
258
289
259
290
-- | The DHParam option can take either a String or a Buffer
260
291
data DHParam
292
+
261
293
dhparamString :: String -> DHParam
262
294
dhparamString = unsafeCoerce
295
+
263
296
dhparamBuffer :: Buffer -> DHParam
264
297
dhparamBuffer = unsafeCoerce
265
298
0 commit comments