added compression feature and made connection timeout configurable