This is an example project demonstrating the construction of a long-poll client in Javascript and the corresponding server in Python. The complete source is available on GitHub.