diff --git a/src/Network/GRPC/HighLevel/Server.hs b/src/Network/GRPC/HighLevel/Server.hs index 5aebd8f..a71cd0b 100644 --- a/src/Network/GRPC/HighLevel/Server.hs +++ b/src/Network/GRPC/HighLevel/Server.hs @@ -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" diff --git a/src/Network/GRPC/HighLevel/Server/Unregistered.hs b/src/Network/GRPC/HighLevel/Server/Unregistered.hs index 5c06793..ea91fbb 100644 --- a/src/Network/GRPC/HighLevel/Server/Unregistered.hs +++ b/src/Network/GRPC/HighLevel/Server/Unregistered.hs @@ -82,7 +82,7 @@ serverLoop ServerOptions{..} = do wait tid where config = ServerConfig - { host = "localhost" + { host = optServerHost , port = optServerPort , methodsToRegisterNormal = [] , methodsToRegisterClientStreaming = [] diff --git a/src/Network/GRPC/LowLevel.hs b/src/Network/GRPC/LowLevel.hs index 63269a5..69f371f 100644 --- a/src/Network/GRPC/LowLevel.hs +++ b/src/Network/GRPC/LowLevel.hs @@ -31,6 +31,7 @@ GRPC , Arg(..) , CompressionAlgorithm(..) , CompressionLevel(..) +, Host , Port -- * Server