Threadsafe connection proxy