Write the code to read haproxy socket