Skip to content

A useful Haskell library for running a pingable server within another application, which is useful for health checks and the like. This library runs a background server that listens on a port, and when a connection comes in, it writes "pong" and closes the connection.

License

RobertFischer/pong-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Haskell Pong Server for Easy Pinging

For cloud-deployed apps, you often want to be able to monitor for the liveness and responsiveness of a particular process on the virtual server. There are some cute ways to do this that involve monitoring the process list, as well as checking for CPU and other resource usage. This library enables a simpler approach: run a TCP server that you can connect to and "ping" (in the loosest sense of the word "ping"). By default, the server runs on 10411 and just responds with the four characters "pong" in the system encoding. You can configure the port to any number you would like, and you can make the server say anything you want by passing in an action that returns a ByteString.

Synopsis

import Network.Pong

main :: IO ()
main = withPongServer defaultPongConfig $ do
  -- your code goes here

Documentation

See the Haddock.

About

A useful Haskell library for running a pingable server within another application, which is useful for health checks and the like. This library runs a background server that listens on a port, and when a connection comes in, it writes "pong" and closes the connection.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published