Updated haproxy.py: Opening socket only once.