0 | module Network.SCGI.Config
 1 |
 2 | import Data.ByteString
 3 | import Data.Nat
 4 | import Data.Vect
 5 | import IO.Async.Logging
 6 |
 7 | %default total
 8 |
 9 | --------------------------------------------------------------------------------
10 | --          Config
11 | --------------------------------------------------------------------------------
12 |
13 | public export
14 | record Config where
15 |   [noHints]
16 |   constructor C
17 |   ||| Address to which the server socket should be bound
18 |   address             : Vect 4 Bits8
19 |
20 |   ||| Port to use for the server
21 |   port                : Bits16
22 |
23 |   ||| Maximum number of bytes allowed in SCGI-message header 
24 |   maxHeaderSize       : Nat
25 |
26 |   ||| Maximum number of bytes allowed in the message content
27 |   maxMsgSize          : Nat
28 |
29 |   ||| Number of concurrent requests
30 |   concurrent          : Nat
31 |
32 |   {auto 0 prf         : IsSucc concurrent}
33 |
34 | --------------------------------------------------------------------------------
35 | --          Utilities
36 | --------------------------------------------------------------------------------
37 |
38 | ||| Default config for testing the cyby server locally
39 | export
40 | local : Config
41 | local = C {
42 |     address        = [0,0,0,0]
43 |   , port           = 4000
44 |   , maxMsgSize     = 0xffffff
45 |   , maxHeaderSize  = 0xfff0
46 |   , concurrent     = 10
47 |   }
48 |