relay: add concept of socket provider and add provider based on configuration and tests for it