Add host option to high-level API

This commit is contained in:
Phil Freeman 2016-10-26 14:43:11 -07:00
parent a12e5ae8a0
commit 950f4cdefa
3 changed files with 5 additions and 1 deletions

View file

@ -152,6 +152,8 @@ data ServerOptions = ServerOptions
-- ^ Handlers for server streaming calls.
, optBiDiStreamHandlers :: [Handler 'BiDiStreaming]
-- ^ Handlers for bidirectional streaming calls.
, optServerHost :: Host
-- ^ Name of the host the server is running on.
, optServerPort :: Port
-- ^ Port on which to listen for requests.
, optUseCompression :: Bool
@ -174,6 +176,7 @@ defaultOptions = ServerOptions
, optClientStreamHandlers = []
, optServerStreamHandlers = []
, optBiDiStreamHandlers = []
, optServerHost = "localhost"
, optServerPort = 50051
, optUseCompression = False
, optUserAgentPrefix = "grpc-haskell/0.0.0"

View file

@ -82,7 +82,7 @@ serverLoop ServerOptions{..} = do
wait tid
where
config = ServerConfig
{ host = "localhost"
{ host = optServerHost
, port = optServerPort
, methodsToRegisterNormal = []
, methodsToRegisterClientStreaming = []

View file

@ -31,6 +31,7 @@ GRPC
, Arg(..)
, CompressionAlgorithm(..)
, CompressionLevel(..)
, Host
, Port
-- * Server