In fact, Gitter uses Pavan's excellent Octonode library (https://github.com/pksunkara/octonode) for all it's communications with Github.