@@ -6,29 +6,6 @@ module Node.HTTP
6
6
, Response
7
7
, HTTP
8
8
9
- , createServerS
10
- , SSLOptions
11
- , handshakeTimeout
12
- , requestCert
13
- , rejectUnauthorized
14
- , npnProtocols
15
- , alpnProtocols
16
- , sessionTimeout
17
- , ticketKeys
18
- , pfx
19
- , key
20
- , passphrase
21
- , cert
22
- , ca
23
- , crl
24
- , ciphers
25
- , honorCipherOrder
26
- , ecdhCurve
27
- , dhparam
28
- , secureProtocol
29
- , secureOptions
30
- , sessionIdContext
31
-
32
9
, createServer
33
10
, listen
34
11
, ListenOptions
@@ -51,13 +28,10 @@ import Prelude
51
28
52
29
import Control.Monad.Eff (Eff , kind Effect )
53
30
54
- import Data.Foreign (Foreign )
55
31
import Data.Maybe (Maybe )
56
32
import Data.Nullable (Nullable , toNullable )
57
- import Data.Options (Options , Option , options , opt )
58
33
import Data.StrMap (StrMap )
59
34
60
- import Node.Buffer (Buffer )
61
35
import Node.Stream (Writable , Readable )
62
36
63
37
import Unsafe.Coerce (unsafeCoerce )
@@ -77,114 +51,6 @@ foreign import data HTTP :: Effect
77
51
-- | Create a HTTP server, given a function to be executed when a request is received.
78
52
foreign import createServer :: forall eff . (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) -> Eff (http :: HTTP | eff ) Server
79
53
80
- -- | The type of HTTPS server options
81
- data SSLOptions
82
-
83
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
84
- handshakeTimeout :: Option SSLOptions Int
85
- handshakeTimeout = opt " handshakeTimeout"
86
-
87
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
88
- requestCert :: Option SSLOptions Boolean
89
- requestCert = opt " requestCert"
90
-
91
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
92
- rejectUnauthorized :: Option SSLOptions Boolean
93
- rejectUnauthorized = opt " rejectUnauthorized"
94
-
95
- -- | The type variable t should be a string[], Buffer[], Uint8Array[], Buffer,
96
- -- | or Uint8Array.
97
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
98
- npnProtocols :: forall t . Option SSLOptions t
99
- npnProtocols = opt " NPNProtocols"
100
-
101
- -- | The type variable t should be a string[], Buffer[], Uint8Array[], Buffer,
102
- -- | or Uint8Array.
103
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
104
- alpnProtocols :: forall t . Option SSLOptions t
105
- alpnProtocols = opt " ALPNProtocols"
106
-
107
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
108
- sessionTimeout :: Option SSLOptions Int
109
- sessionTimeout = opt " sessionTimeout"
110
-
111
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createserver_options_secureconnectionlistener)
112
- ticketKeys :: Option SSLOptions Buffer
113
- ticketKeys = opt " ticketKeys"
114
-
115
- -- | The type variable t should be a string or Buffer.
116
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
117
- pfx :: forall t . Option SSLOptions t
118
- pfx = opt " pfx"
119
-
120
- -- | The type variable t should be a string, string[], Buffer, Buffer[], or
121
- -- | Object[].
122
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
123
- key :: forall t . Option SSLOptions t
124
- key = opt " key"
125
-
126
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
127
- passphrase :: Option SSLOptions String
128
- passphrase = opt " passphrase"
129
-
130
- -- | The type variable t should be a string, string[], Buffer, or Buffer[].
131
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
132
- cert :: forall t . Option SSLOptions t
133
- cert = opt " cert"
134
-
135
- -- | The type variable t should be a string, string[], Buffer, or Buffer[].
136
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
137
- ca :: forall t . Option SSLOptions t
138
- ca = opt " ca"
139
-
140
- -- | The type variable t should be a string, string[], Buffer, or Buffer[].
141
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
142
- crl :: forall t . Option SSLOptions t
143
- crl = opt " crl"
144
-
145
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
146
- ciphers :: Option SSLOptions String
147
- ciphers = opt " ciphers"
148
-
149
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
150
- honorCipherOrder :: Option SSLOptions Boolean
151
- honorCipherOrder = opt " honorCipherOrder"
152
-
153
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
154
- ecdhCurve :: Option SSLOptions String
155
- ecdhCurve = opt " ecdhCurve"
156
-
157
- -- | The type variable t should be a string or Buffer.
158
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
159
- dhparam :: forall t . Option SSLOptions t
160
- dhparam = opt " dhparam"
161
-
162
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
163
- secureProtocol :: Option SSLOptions String
164
- secureProtocol = opt " secureProtocol"
165
-
166
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
167
- secureOptions :: Option SSLOptions Int
168
- secureOptions = opt " secureOptions"
169
-
170
- -- | See the [node docs](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options)
171
- sessionIdContext :: Option SSLOptions String
172
- sessionIdContext = opt " sessionIdContext"
173
-
174
- foreign import createServerSImpl ::
175
- forall eff .
176
- Foreign ->
177
- (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) ->
178
- Eff (http :: HTTP | eff ) Server
179
-
180
- -- | Create an HTTPS server, given the SSL options and a function to be executed
181
- -- | when a request is received.
182
- createServerS :: forall eff .
183
- Options SSLOptions ->
184
- (Request -> Response -> Eff (http :: HTTP | eff ) Unit ) ->
185
- Eff (http :: HTTP | eff ) Server
186
- createServerS = createServerSImpl <<< options
187
-
188
54
foreign import listenImpl :: forall eff . Server -> Int -> String -> Nullable Int -> Eff (http :: HTTP | eff ) Unit -> Eff (http :: HTTP | eff ) Unit
189
55
190
56
-- | Listen on a port in order to start accepting HTTP requests. The specified callback will be run when setup is complete.
0 commit comments