1
1
module Node.Http2.Server
2
2
( toTlsServer
3
3
, createSecureServer
4
- , createSecureServer'
5
4
, checkContinueHandle
6
5
, requestHandle
7
6
, sessionHandle
@@ -24,39 +23,21 @@ import Node.EventEmitter (EventHandle(..))
24
23
import Node.EventEmitter.UtilTypes (EventHandle1 , EventHandle2 , EventHandle4 , EventHandle0 )
25
24
import Node.Http2.Flags (BitwiseFlag )
26
25
import Node.Http2.Types (Headers , Http2CreateSecureServerOptions , Http2SecureServer , Http2ServerRequest , Http2ServerResponse , Http2Session , Http2Stream , Settings )
27
- import Node.Net.Types (NewServerOptions , TCP )
28
- import Node.Net.Types as NetTypes
26
+ import Node.Net.Types (NewServerOptions )
29
27
import Node.Stream (Duplex )
30
- import Node.TLS.Server as TlsServer
31
28
import Node.TLS.Types (CreateSecureContextOptions , Server , TlsCreateServerOptions , TlsServer )
32
29
import Prim.Row as Row
33
30
import Unsafe.Coerce (unsafeCoerce )
34
31
35
32
toTlsServer :: Http2SecureServer -> TlsServer
36
33
toTlsServer = unsafeCoerce
37
34
38
- -- | Same as `createSecureServer` but provides the value as each of its subclasses via record syntax
39
- -- | for ease of use.
40
35
createSecureServer
41
- :: forall rec trash
42
- . Row.Union rec trash (Http2CreateSecureServerOptions (TlsCreateServerOptions Server (CreateSecureContextOptions (NewServerOptions ()))))
43
- => { | rec }
44
- -> Effect { http2 :: Http2SecureServer , tls :: TlsServer , net :: NetTypes.Server TCP }
45
- createSecureServer options = (runEffectFn1 createSecureServerImpl options) <#> \http2 -> do
46
- let
47
- tls = toTlsServer http2
48
- net = TlsServer .toNetServer tls
49
- { http2
50
- , tls
51
- , net
52
- }
53
-
54
- createSecureServer'
55
36
:: forall rec trash
56
37
. Row.Union rec trash (Http2CreateSecureServerOptions (TlsCreateServerOptions Server (CreateSecureContextOptions (NewServerOptions ()))))
57
38
=> { | rec }
58
39
-> Effect Http2SecureServer
59
- createSecureServer' options = runEffectFn1 createSecureServerImpl options
40
+ createSecureServer options = runEffectFn1 createSecureServerImpl options
60
41
61
42
foreign import createSecureServerImpl :: forall r . EffectFn1 { | r } (Http2SecureServer )
62
43
0 commit comments