port from data-speed project and ruby client